int ledPin = 3; int outPin = 2; void setup() { pinMode(ledPin, OUTPUT); pinMode(outPin, OUTPUT); } void loop(){ // 3 dits for (int x=0; x<3; x++) { digitalWrite(ledPin, HIGH); digitalWrite(outPin, HIGH); delay(150); digitalWrite(ledPin, LOW); digitalWrite(outPin, LOW); delay(150); } delay(300); for (int x=0; x<3; x++) { digitalWrite(ledPin, HIGH); delay(450); digitalWrite(ledPin, LOW); delay(150); } delay(300); // 3 dits for (int x=0; x<3; x++) { digitalWrite(ledPin, HIGH); delay(150); digitalWrite(ledPin, LOW); delay(150); } delay(1050); }
Arduino 2
int inPin = 12; int ledPin = 9; int val = 0; void setup() { pinMode(ledPin, OUTPUT); pinMode(inPin, INPUT); Serial.begin(9600); } void loop() { Serial.println(" "); val = digitalRead(inPin); digitalWrite(ledPin, val); Serial.println(val); }