]> git.scottworley.com Git - tattlekey/blame - client/blink.c
client: next_scheduled_send()
[tattlekey] / client / blink.c
CommitLineData
dae35db7
SW
1#include "pico/cyw43_arch.h"
2#include "pico/stdlib.h"
3
4#include "blink.h"
5
6void one_blink(int duration) {
7 cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 1);
8 sleep_ms(duration);
9 cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 0);
10 sleep_ms(duration);
11}
12
13void signal(int count, int duration) {
14 for (int i = 0; i < count; i++)
15 one_blink(duration);
16 sleep_ms(1000);
17}
18
19void blink_forever(int duration) {
20 while (true) {
21 one_blink(duration);
22 }
23}
24
25void signal_error_by_blinking() { blink_forever(100); }
26void signal_success_by_blinking() { blink_forever(400); }