// include the library code: #include #include #include "pitches.h" int IRpin = 10; // pin for the IR sensor IRrecv irrecv(IRpin); decode_results results; int x=1; int y=1; int z=1; // initialize the library by associating any needed LCD interface pin // with the arduino pin number it is connected to const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2; LiquidCrystal lcd(rs, en, d4, d5, d6, d7); void setup() { irrecv.enableIRIn(); // Start the receiver // set up the LCD's number of columns and rows: lcd.begin(16, 2); // Print a message to the LCD. lcd.print("Shake Your Brain"); delay(4000); //pinMode(6,OUTPUT); pinMode(7,INPUT); pinMode(8,OUTPUT); pinMode(9,OUTPUT); pinMode(A1,INPUT); pinMode(A2,INPUT); pinMode(A0,INPUT); pinMode(6,OUTPUT); } void loop() { // set the cursor to column 0, line 1 // (note: line 1 is the second row, since counting begins with 0): lcd.clear(); lcd.setCursor(0, 0); lcd.print("Time to warm up"); for (int i=20 ; i>=0 ; i--){ lcd.clear(); lcd.setCursor(0, 0); lcd.print("Time to warm up"); lcd.setCursor(0,1); lcd.print(i); if(digitalRead(A1)==1){ digitalWrite(9,HIGH); } else{ digitalWrite(9,LOW); } if(digitalRead(A2)==1){ digitalWrite(8,HIGH); } else{ digitalWrite(8,LOW); } delay(1000); if(i<=3 && i>0){ digitalWrite(8,HIGH); delay(1000); digitalWrite(8,LOW); delay(1000); } if(i==0){ for(int y=5; y>=0; y--){ digitalWrite(8,HIGH); delay(100); digitalWrite(8,LOW); delay(100);} } } lcd.clear(); lcd.setCursor(0, 0); lcd.print("Pick the Remote"); lcd.setCursor(0, 1); lcd.print("To choose Leader"); while(x==1){ if (irrecv.decode(&results)) { irrecv.resume(); // Receive the next value } if (results.value == 16726215) // change zero to your IR remote button number { lcd.clear(); lcd.setCursor(0, 0); lcd.print("U R the Leader"); digitalWrite(9,HIGH); delay(3000); digitalWrite(9,LOW); x=0; } else{ digitalWrite(8,HIGH); delay(3000); digitalWrite(8,LOW); } } delay(2000); lcd.clear(); lcd.setCursor(0, 0); lcd.print("First step"); delay(2000); lcd.setCursor(0, 1); lcd.print("Choose User/Idea"); delay(2000); while(y==1){ lcd.clear(); lcd.setCursor(0, 0); lcd.print("Choose User/Idea"); lcd.setCursor(0, 1); lcd.print("Knock once done"); delay(100); if(analogRead(A0) > 300){ y=0; lcd.clear(); lcd.setCursor(0, 0); lcd.print("Good Job"); delay(3000); } } //second one x=1; y=1; lcd.clear(); lcd.setCursor(0, 0); lcd.print("Pick the Remote"); lcd.setCursor(0, 1); lcd.print("To choose Leader"); while(x==1){ if (irrecv.decode(&results)) { irrecv.resume(); // Receive the next value } if (results.value == 16728765) // change zero to your IR remote button number { lcd.clear(); lcd.setCursor(0, 0); lcd.print("U R the Leader"); digitalWrite(9,HIGH); delay(3000); digitalWrite(9,LOW); x=0; } else{ digitalWrite(8,HIGH); delay(3000); digitalWrite(8,LOW); } } delay(2000); lcd.clear(); lcd.setCursor(0, 0); lcd.print("Second step"); delay(2000); lcd.setCursor(0, 1); lcd.print("Substitute"); delay(2000); while(y==1){ lcd.clear(); lcd.setCursor(0, 0); lcd.print("Substitute"); lcd.setCursor(0, 1); lcd.print("Knock once done"); delay(100); if(analogRead(A0) > 300){ y=0; lcd.clear(); lcd.setCursor(0, 0); lcd.print("Good Job"); delay(3000); } } //third one x=1; y=1; lcd.clear(); lcd.setCursor(0, 0); lcd.print("Pick the Remote"); lcd.setCursor(0, 1); lcd.print("To choose Leader"); while(x==1){ if (irrecv.decode(&results)) { irrecv.resume(); // Receive the next value } if (results.value == 16724175) // change zero to your IR remote button number { lcd.clear(); lcd.setCursor(0, 0); lcd.print("U R the Leader"); digitalWrite(9,HIGH); delay(3000); digitalWrite(9,LOW); x=0; } else{ digitalWrite(8,HIGH); delay(3000); digitalWrite(8,LOW); } } delay(2000); lcd.clear(); lcd.setCursor(0, 0); lcd.print("Third step"); delay(2000); lcd.setCursor(0, 1); lcd.print("Combine"); delay(2000); while(y==1){ lcd.clear(); lcd.setCursor(0, 0); lcd.print("Combine"); lcd.setCursor(0, 1); lcd.print("Knock once done"); delay(100); if(analogRead(A0) > 300){ y=0; lcd.clear(); lcd.setCursor(0, 0); lcd.print("Good Job"); delay(3000); } } //fourth one x=1; y=1; lcd.clear(); lcd.setCursor(0, 0); lcd.print("Pick the Remote"); lcd.setCursor(0, 1); lcd.print("To choose Leader"); while(x==1){ if (irrecv.decode(&results)) { irrecv.resume(); // Receive the next value } if (results.value == 16743045) // change zero to your IR remote button number { lcd.clear(); lcd.setCursor(0, 0); lcd.print("U R the Leader"); digitalWrite(9,HIGH); delay(3000); digitalWrite(9,LOW); x=0; } else{ digitalWrite(8,HIGH); delay(3000); digitalWrite(8,LOW); } } delay(2000); lcd.clear(); lcd.setCursor(0, 0); lcd.print("Fourth step"); delay(2000); lcd.setCursor(0, 1); lcd.print("Adapt"); delay(2000); while(y==1){ lcd.clear(); lcd.setCursor(0, 0); lcd.print("Adapt"); lcd.setCursor(0, 1); lcd.print("Knock once done"); delay(100); if(analogRead(A0) > 300){ y=0; lcd.clear(); lcd.setCursor(0, 0); lcd.print("Good Job"); delay(3000); } } //fifth one x=1; y=1; lcd.clear(); lcd.setCursor(0, 0); lcd.print("Pick the Remote"); lcd.setCursor(0, 1); lcd.print("To choose Leader"); while(x==1){ if (irrecv.decode(&results)) { irrecv.resume(); // Receive the next value } if (results.value == 16718055) // change zero to your IR remote button number { lcd.clear(); lcd.setCursor(0, 0); lcd.print("U R the Leader"); digitalWrite(9,HIGH); delay(3000); digitalWrite(9,LOW); x=0; } else{ digitalWrite(8,HIGH); delay(3000); digitalWrite(8,LOW); } } delay(2000); lcd.clear(); lcd.setCursor(0, 0); lcd.print("Fifth step"); delay(2000); lcd.setCursor(0, 1); lcd.print("Modify"); delay(2000); while(y==1){ lcd.clear(); lcd.setCursor(0, 0); lcd.print("Modify"); lcd.setCursor(0, 1); lcd.print("Knock once done"); delay(100); if(analogRead(A0) > 300){ y=0; lcd.clear(); lcd.setCursor(0, 0); lcd.print("Good Job"); delay(3000); } } //sixth one x=1; y=1; lcd.clear(); lcd.setCursor(0, 0); lcd.print("Pick the Remote"); lcd.setCursor(0, 1); lcd.print("To choose Leader"); while(x==1){ if (irrecv.decode(&results)) { irrecv.resume(); // Receive the next value } if (results.value == 16716015) // change zero to your IR remote button number { lcd.clear(); lcd.setCursor(0, 0); lcd.print("U R the Leader"); digitalWrite(9,HIGH); delay(3000); digitalWrite(9,LOW); x=0; } else{ digitalWrite(8,HIGH); delay(3000); digitalWrite(8,LOW); } } delay(2000); lcd.clear(); lcd.setCursor(0, 0); lcd.print("Sixth step"); delay(2000); lcd.setCursor(0, 1); lcd.print("Put to another use"); delay(2000); while(y==1){ lcd.clear(); lcd.setCursor(0, 0); lcd.print("Put to another use"); lcd.setCursor(0, 1); lcd.print("Knock once done"); delay(100); if(analogRead(A0) > 300){ y=0; lcd.clear(); lcd.setCursor(0, 0); lcd.print("Good Job"); delay(3000); } } //seventh one x=1; y=1; lcd.clear(); lcd.setCursor(0, 0); lcd.print("Pick the Remote"); lcd.setCursor(0, 1); lcd.print("To choose Leader"); while(x==1){ if (irrecv.decode(&results)) { irrecv.resume(); // Receive the next value } if (results.value == 16730805) // change zero to your IR remote button number { lcd.clear(); lcd.setCursor(0, 0); lcd.print("U R the Leader"); digitalWrite(9,HIGH); delay(3000); digitalWrite(9,LOW); x=0; } else{ digitalWrite(8,HIGH); delay(3000); digitalWrite(8,LOW); } } delay(2000); lcd.clear(); lcd.setCursor(0, 0); lcd.print("Seventh step"); delay(2000); lcd.setCursor(0, 1); lcd.print("Eliminate"); delay(2000); while(y==1){ lcd.clear(); lcd.setCursor(0, 0); lcd.print("Eliminate"); lcd.setCursor(0, 1); lcd.print("Knock once done"); delay(100); if(analogRead(A0) > 300){ y=0; lcd.clear(); lcd.setCursor(0, 0); lcd.print("Good Job"); delay(3000); } } //eighth one x=1; y=1; lcd.clear(); lcd.setCursor(0, 0); lcd.print("Pick the Remote"); lcd.setCursor(0, 1); lcd.print("To choose Leader"); while(x==1){ if (irrecv.decode(&results)) { irrecv.resume(); // Receive the next value } if (results.value == 16734885) // change zero to your IR remote button number { lcd.clear(); lcd.setCursor(0, 0); lcd.print("U R the Leader"); digitalWrite(9,HIGH); delay(3000); digitalWrite(9,LOW); x=0; } else{ digitalWrite(8,HIGH); delay(3000); digitalWrite(8,LOW); } } delay(2000); lcd.clear(); lcd.setCursor(0, 0); lcd.print("Eighth step"); delay(2000); lcd.setCursor(0, 1); lcd.print("Reverse"); delay(2000); while(y==1){ lcd.clear(); lcd.setCursor(0, 0); lcd.print("Reverse"); lcd.setCursor(0, 1); lcd.print("Knock once done"); delay(100); if(analogRead(A0) > 300){ y=0; lcd.clear(); lcd.setCursor(0, 0); lcd.print("Good Job"); delay(3000); } } while(z==1){ lcd.clear(); lcd.setCursor(0, 0); lcd.print("Build Your Idea"); delay(150); if(digitalRead(7)==1){ lcd.clear(); lcd.setCursor(0, 0); lcd.print("You Are Done!"); delay(150); lcd.setCursor(0, 1); lcd.print("Congrats!"); delay(5000); lcd.clear(); lcd.setCursor(0, 0); lcd.print("You are about to"); lcd.setCursor(0, 0); lcd.print("Start new Idea!"); delay(3000); z=0; } } }