Skip to content

Instantly share code, notes, and snippets.

@azimut
Created November 17, 2015 23:32
Show Gist options
  • Save azimut/e5835c02e869ba27c092 to your computer and use it in GitHub Desktop.
Save azimut/e5835c02e869ba27c092 to your computer and use it in GitHub Desktop.
duino code
#define LED1 8
#define LED2 9
#define LED3 10
#define LED4 11
#define LED5 12
#define PIN1 3
int leoboton;
void setup()
{
pinMode(PIN1,INPUT);
pinMode(LED1,OUTPUT);
pinMode(LED2,OUTPUT);
pinMode(LED3,OUTPUT);
pinMode(LED4,OUTPUT);
pinMode(LED5,OUTPUT);
Serial.begin(9600);
}
void loop()
{
leoboton = digitalRead(PIN1);
Serial.print(leoboton);
// BLINK
if(leoboton == 1){
for(int c = 8;c<=12;c++){
digitalWrite(c,LOW);
}
delay(500);
for(int a = 8;a<=12;a++){
digitalWrite(a,HIGH);
}
delay(500);
} else {
// SEQUENCE
for(int c = 8;c<=12;c++){
digitalWrite(c,LOW);
}
for(int b = 8;b<=12;b++){
digitalWrite(b,HIGH);
delay(100);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment