Pico Led Controller
1.0.3
A project to control LEDs using Raspberry Pi Pico W
Loading...
Searching...
No Matches
blink.c
Go to the documentation of this file.
1
#include "
blink.h
"
2
3
#include <stdio.h>
4
5
#include <pico/stdlib.h>
6
#include <pico/cyw43_arch.h>
7
8
#include "
light_state.h
"
9
10
void
onboard_led_blink
(uint32_t on_time, uint32_t off_time)
11
{
12
if
(on_time < 10)
13
on_time = 10;
14
if
(off_time < 10)
15
off_time = 10;
16
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 1);
17
sleep_ms(on_time);
18
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 0);
19
sleep_ms(off_time);
20
}
21
22
void
led_blink
(uint32_t on_time, uint32_t off_time)
23
{
24
if
(on_time < 10)
25
on_time = 10;
26
if
(off_time < 10)
27
off_time = 10;
28
toggle_light_state
();
29
sleep_ms(on_time);
30
toggle_light_state
();
31
sleep_ms(off_time);
32
}
led_blink
void led_blink(uint32_t on_time, uint32_t off_time)
Blink the LED strip.
Definition
blink.c:22
onboard_led_blink
void onboard_led_blink(uint32_t on_time, uint32_t off_time)
Blink the onboard LED.
Definition
blink.c:10
blink.h
light_state.h
toggle_light_state
void toggle_light_state()
Toggle light state.
Definition
light_state.c:10
led_controller
src
blink.c
Generated by
1.9.8