WeMOS D1 mini: blink: Difference between revisions

From OnnoCenterWiki
Jump to navigationJump to search
Created page with "Ref: https://github.com/wemos/D1_mini_Examples /* * Blink * Turns on the onboard LED on for one second, then off for one second, repeatedly. * This uses delay() to pa..."
 
No edit summary
 
Line 1: Line 1:
Ref: https://github.com/wemos/D1_mini_Examples
Ref: https://github.com/wemos/D1_mini_Examples
Build-In LED = D4





Latest revision as of 14:38, 21 March 2023

Ref: https://github.com/wemos/D1_mini_Examples

Build-In LED = D4


/*
 * Blink
 * Turns on the onboard LED on for one second, then off for one second, repeatedly.
 * This uses delay() to pause between LED toggles.
 */

void setup() {
  pinMode(BUILTIN_LED, OUTPUT);  // initialize onboard LED as output
}

void loop() {
  digitalWrite(BUILTIN_LED, HIGH);  // turn on LED with voltage HIGH
  delay(1000);                      // wait one second
  digitalWrite(BUILTIN_LED, LOW);   // turn off LED with voltage LOW
  delay(1000);                      // wait one second
}