Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int message = 0;
- void setup() {
- Serial.begin(9600);
- // put your setup code here, to run once:
- pinMode(13, OUTPUT); // VODKA
- pinMode(12, OUTPUT); // CRANBERRY
- pinMode(8, OUTPUT);// COINTRAU
- pinMode(7, OUTPUT); // CITRON
- pinMode(4, OUTPUT); // TEQUILA
- digitalWrite(4, HIGH);
- digitalWrite(7, HIGH);
- digitalWrite(8, HIGH);
- digitalWrite(12, HIGH);
- digitalWrite(13, HIGH);
- Serial.println("Pret pour les cocktails");
- }
- void loop() {
- // put your main code here, to run repeatedly:
- if (Serial.available()) {
- message = Serial.read() - '0';
- Serial.println(message);
- if (message == 1) {
- Serial.println("Cosmo en cours ");
- digitalWrite(8, LOW);
- digitalWrite(7, LOW);
- digitalWrite(12, LOW);
- digitalWrite(13, LOW);
- delay(10000);
- Serial.println("Cosmo dans 30s");
- digitalWrite(8, HIGH);
- delay(10000);
- Serial.println("Cosmo dans 20s");
- digitalWrite(7, HIGH);
- digitalWrite(12, HIGH);
- delay(20000);
- Serial.println("Cosmo fini");
- digitalWrite(13, HIGH);
- }
- }
- delay(1000);
- message = 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement