code update
This commit is contained in:
24
MilliOhmMeter_FW/src/leds.cpp
Normal file
24
MilliOhmMeter_FW/src/leds.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "leds.h"
|
||||
|
||||
uint64_t lastLedTimer = 0;
|
||||
bool ledBlinkState = false;
|
||||
|
||||
void initLeds(void)
|
||||
{
|
||||
Serial.print("Init Leds: ");
|
||||
pinMode(LED_BUILTIN, OUTPUT);
|
||||
digitalWrite(LED_BUILTIN, ledBlinkState );
|
||||
lastLedTimer = millis();
|
||||
Serial.println("OK");
|
||||
}
|
||||
|
||||
void handleLeds(void)
|
||||
{
|
||||
uint64_t currentTime = millis();
|
||||
if(currentTime - lastLedTimer > LEDINTERVAL)
|
||||
{
|
||||
digitalWrite(LED_BUILTIN, ledBlinkState);
|
||||
ledBlinkState = !ledBlinkState;
|
||||
lastLedTimer = currentTime;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user