// Sketch by Vasant, with reference from Dr. PW Dandekars ioT workshop. #include LiquidCrystal lcd(12, 11, 5, 4, 3, 2); const int O_ard0PIN = A0; const int O_ard1PIN = A1; int O_ard0 = 0; int O_ard1 = 0; const int LEFTPIN = A2; const int RIGHTPIN = A3; const int BRAKEPIN = A4; const int PARKPIN = A5; int LEFT_SHIFT = 0; int RIGHT_SHIFT = 0; int BRAKE = 0; int P_D = 0; void setup() { pinMode(O_ard0PIN, INPUT); pinMode(O_ard1PIN, INPUT); pinMode(LEFTPIN, INPUT); pinMode(RIGHTPIN, INPUT); pinMode(BRAKEPIN, INPUT); pinMode(PARKPIN, INPUT); lcd.begin(16, 2); lcd.setCursor(0,0); lcd.print("Hello There!!"); delay (2000); lcd.clear(); lcd.setCursor(0,0); lcd.print("Thiss' our EE224"); lcd.setCursor(0,1); lcd.print("Course Project"); delay (2000); lcd.clear(); lcd.setCursor(0,0); lcd.print("OBSTACLE AVOIDING"); lcd.setCursor(0,1); lcd.print("LANE SHIFTER"); delay (2000); lcd.clear(); lcd.setCursor(0,0); lcd.print("Vasant , Manika"); lcd.setCursor(0,1); lcd.print("Vaishnavi, Siddharth"); delay(2000); lcd.clear(); } void loop() { O_ard1 = digitalRead(O_ard1PIN); O_ard0 = digitalRead(O_ard0PIN); LEFT_SHIFT = digitalRead(LEFTPIN); RIGHT_SHIFT = digitalRead(RIGHTPIN); BRAKE = digitalRead(BRAKEPIN); P_D = digitalRead(PARKPIN); if ((O_ard1 == 0) and (O_ard0 == 0)) {lcd.setCursor(0,0); lcd.print("4 | | |:A:"); } else if ((O_ard1 == 0) and (O_ard0 == 1)) {lcd.setCursor(0,0); lcd.print("3 | |:A:| "); } else if ((O_ard1 == 1) and (O_ard0 == 0)) {lcd.setCursor(0,0); lcd.print("2 |:A:| | "); } else if ((O_ard1 == 1) and (O_ard0 == 1)) {lcd.setCursor(0,0); lcd.print("1:A:| | | "); }; //if ((RIGHT_SHIFT == 0) and (LEFT_SHIFT == 0)) {lcd.setCursor(0,0); lcd.print("MAINTAIN LANE "); } if ((RIGHT_SHIFT == 1) and (LEFT_SHIFT == 0)) {lcd.setCursor(0,1); lcd.print(" ->"); } else if ((RIGHT_SHIFT == 0) and (LEFT_SHIFT == 1)) {lcd.setCursor(0,1); lcd.print("<- "); }; //else if ((RIGHT_SHIFT == 1) and (LEFT_SHIFT == 1)) {lcd.setCursor(0,0); lcd.print("MANUAL OVERRIDE"); }; if (BRAKE == 1) {lcd.setCursor(4,1); lcd.print("B"); } else {lcd.setCursor(4,1); lcd.print("C"); }; if (P_D == 1) {lcd.setCursor(7,1); lcd.print("PARK MODE"); } else {lcd.setCursor(7,1); lcd.print("DRIVEMODE");}; delay(10); }