flix/flix/led.ino
2023-12-19 05:06:19 +03:00

22 lines
339 B
C++

// Copyright (c) 2023 Oleg Kalachev <okalachev@gmail.com>
// Repository: https://github.com/okalachev/flix
// Main LED control
#define BLINK_PERIOD 500000
void setupLED()
{
pinMode(LED_BUILTIN, OUTPUT);
}
void setLED(bool on)
{
digitalWrite(LED_BUILTIN, on ? HIGH : LOW);
}
void blinkLED()
{
setLED(micros() / BLINK_PERIOD % 2);
}