Created
November 22, 2018 19:34
-
-
Save alvarowolfx/71ee075033d0bc9b543e92dbb5638176 to your computer and use it in GitHub Desktop.
Google Cloud OTA Update Post - Blink
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup(){ | |
/* ... */ | |
pinMode(LED_BUILTIN, OUTPUT); | |
} | |
int ledState = LOW; | |
const long interval = 1000; | |
unsigned long previousMillis = 0; | |
void loop() | |
{ | |
unsigned long currentMillis = millis(); | |
if (currentMillis - previousMillis >= interval) { | |
previousMillis = currentMillis; | |
ledState = ledState == LOW ? HIGH : LOW; | |
digitalWrite( BUILTIN_LED, ledState ); | |
} | |
// Just chill | |
server.handleClient(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment