BLINK
Código:
void setup() {
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH);
delay(100);
digitalWrite(13, LOW);
delay(10);
}
int redLedPin=12;
int yellowLedPin=11;
int greenLedPin=10;
void setup(){
pinMode(redLedPin, OUTPUT);
pinMode(yellowLedPin, OUTPUT);
pinMode(greenLedPin, OUTPUT);
}
void loop(){
digitalWrite(redLedPin, LOW);
digitalWrite(yellowLedPin, LOW);
digitalWrite(greenLedPin, HIGH);
delay(3000);
digitalWrite(redLedPin, LOW);
digitalWrite(yellowLedPin, HIGH);
digitalWrite(greenLedPin, LOW);
delay(1000);
digitalWrite(redLedPin, HIGH);
digitalWrite(yellowLedPin, LOW);
digitalWrite(greenLedPin, LOW);
delay(3000);
}
int speakerPin = 8;
void setup() {
pinMode(speakerPin, OUTPUT);
}
void loop() {
digitalWrite(speakerPin, HIGH);
delay(100);
digitalWrite(speakerPin, LOW);
delay(1000);
}