Skip to content

Instantly share code, notes, and snippets.

@mrpatg
Created December 8, 2020 01:52
Show Gist options
  • Save mrpatg/6273e4c0b1a5e3356235d5221e883b49 to your computer and use it in GitHub Desktop.
Save mrpatg/6273e4c0b1a5e3356235d5221e883b49 to your computer and use it in GitHub Desktop.
Factorio Lab Lamp Arduino/NodeMCU 3 LED Script
#define LED0 D0 // Led in NodeMCU at pin GPIO16 (D0).
#define LED1 D6
#define LED2 D7
#define LED3 D8
void setup() {
pinMode(LED0, OUTPUT); // set the digital pin as output.
pinMode(LED1, OUTPUT); // set the digital pin as output.
pinMode(LED2, OUTPUT); // set the digital pin as output.
pinMode(LED3, OUTPUT); // set the digital pin as output.
}
void loop() {
digitalWrite(LED0, LOW);
delay(100);
digitalWrite(LED1, HIGH);
delay(50);
digitalWrite(LED3, HIGH);
delay(50);
digitalWrite(LED0, HIGH);
digitalWrite(LED1, LOW);
digitalWrite(LED2, LOW);
delay(50);
digitalWrite(LED0, LOW);
digitalWrite(LED1, HIGH);
digitalWrite(LED2, HIGH);
digitalWrite(LED3, HIGH);
delay(150);
digitalWrite(LED0, HIGH);
digitalWrite(LED1, LOW);
digitalWrite(LED2, LOW);
digitalWrite(LED3, LOW);
delay(150);
digitalWrite(LED0, LOW);
digitalWrite(LED1, HIGH);
digitalWrite(LED2, HIGH);
digitalWrite(LED3, HIGH);
delay(150);
digitalWrite(LED0, HIGH);
digitalWrite(LED1, LOW);
digitalWrite(LED2, LOW);
digitalWrite(LED3, LOW);
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment