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
10void 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
22void 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;
29 sleep_ms(on_time);
31 sleep_ms(off_time);
32}
void toggle_light_state()
Toggle light state.
Definition light_state.c:10