Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int E = 1;
- int DB4 = 4;
- int DB5 = 5;
- int DB6 = 6;
- int DB7 = 7;
- LiquidCrystal lcd(RS, E, DB4, DB5, DB6, DB7);
- void setup()
- {
- lcd.begin(16,2);
- lcd.setCursor(0,0);
- lcd.print("Tiempo Restante:");
- delay(1000);
- lcd.setCursor(0,1);
- lcd.print("10");
- pinMode(12, OUTPUT);
- pinMode(8, OUTPUT);
- pinMode(2, OUTPUT);
- pinMode(9, OUTPUT);
- pinMode(10, OUTPUT);
- pinMode(0, OUTPUT);
- pinMode(11, OUTPUT);
- }
- void loop()
- {
- digitalWrite(12, HIGH);
- digitalWrite(8, HIGH);
- tone(2, 523, 10000); // play tone 60 (C5 = 523 Hz)
- delay(10000); // Wait for 10000 millisecond(s)
- digitalWrite(12, LOW);
- digitalWrite(8, LOW);
- noTone(2);
- digitalWrite(9, HIGH);
- digitalWrite(10, HIGH);
- tone(2, 92, 10000); // play tone 30 (F#2 = 92 Hz)
- delay(10000); // Wait for 10000 millisecond(s)
- digitalWrite(10, LOW);
- noTone(0);
- digitalWrite(11, HIGH);
- tone(2, 165, 3000); // play tone 40 (E3 = 165 Hz)
- delay(3000); // Wait for 3000 millisecond(s)
- digitalWrite(11, LOW);
- digitalWrite(9, LOW);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement