/* * LCD RS pin to digital pin 12 * LCD Enable pin to digital pin 11 * LCD D4 pin to digital pin 5 * LCD D5 pin to digital pin 4 * LCD D6 pin to digital pin 3 * LCD D7 pin to digital pin 2 * LCD R/W pin to ground * 10K resistor: * ends to +5V and ground * wiper to LCD VO pin (pin 3) EEPROM ADDRESSES 1- Ambient Light OFF 2- Ambient Light ON 3- Daylight Savings */ // include the library code: #include #include // initialize the library with the numbers of the interface pins LiquidCrystal lcd(12, 11, 5, 4, 3, 2); int pagebutton = 0; int pagenumber = 0; int cbradio = 1; int scanner = 1; int gps = 0; int inverter = 1; int foglight = 1; int ledintlight = 2; int sidelight = 1; int garagedoor = 1; int enginestart = 1; int garagelight = 1; int intlight = 1; int unused = 1; int test9 = 1; int test11 = 1; int test12 = 1; int relayfan = 0; int dashlight = 2; int lowbeam = 2; int daylight = 2; int test19 = 1; int test20 = 1; int test21 = 1; int test22 = 1; int test23 = 1; int test24 = 1; int test25 = 1; int test26 = 1; int por = 1; int nextbuttonpin = 6; // the number of the input pin int prevbuttonpin = 13; int button1pin = 2; int button2pin = 3; int button3pin = 4; int button4pin = 5; int state = HIGH; // the current state of the output pin int reading; // the current reading from the input pin int previous = LOW; // the previous reading from the input pin byte relay = 0; byte relay2 = 0; byte relay3 = 0; byte blank = 0; byte testrelay1 = 0; byte testrelay2 = 0; byte testrelay3 = 0; int testallrelay = 0; long viewrelay = 256; long viewrelay2 = 256; long viewrelay3 = 256; // the follow variables are long's because the time, measured in miliseconds, // will quickly become a bigger number than can be stored in an int. long time = 0; // the last time the output pin was toggled long debounce = 200; // the debounce time, increase if the output flickers long previousMillis = 0; // will store last time LED was updated // the follow variables is a long because the time, measured in miliseconds, // will quickly become a bigger number than can be stored in an int. long interval = 10000; // interval at which to blink (milliseconds) int timereset = 0; //lightsensor const int numReadings = 10; int lightsensor = 0; int amblight = 0; int amblightcurrent = 0; int amblighton = 100; int amblightoff = 200; //tempsensor int tempsensor = 1; int temp = 1; //RTC int daylightsavings = 0; // FOR SHIFT REGISTER int data = 8; int clock = 10; int latch = 9; int shiftenable = 7; //Used for single LED manipulation int ledState = 0; const int ON = HIGH; const int OFF = LOW; void setup() { // set up the LCD's number of columns and rows: lcd.begin(20, 4); //EEPROM amblighton = EEPROM.read(2); amblightoff = EEPROM.read(1); //RTC //daylightsavings daylightsavings = EEPROM.read(3); //FOR GARAGE CONTROL pinMode(6, OUTPUT); pinMode(13, OUTPUT); //SHIFT REGISTER pinMode(data, OUTPUT); pinMode(clock, OUTPUT); pinMode(latch, OUTPUT); pinMode(shiftenable, OUTPUT); digitalWrite(shiftenable, HIGH); digitalWrite(latch, LOW); //Pulls the chips latch low shiftOut(data, clock, MSBFIRST, blank); //Shifts out the 8 bits to the shift register shiftOut(data, clock, MSBFIRST, blank); //Shifts out the 8 bits to the shift register digitalWrite(latch, HIGH); //Pulls the latch high displaying the data lcd.print(" JeePuter 2.6 "); lcd.setCursor(0, 1); lcd.print(" "); lcd.setCursor(0, 2); lcd.print(" 1998 Jeep Wrangler "); lcd.setCursor(0, 3); lcd.print(" Ed Zarick's Jeep "); delay(2000); lcd.clear(); } void loop() { //TEST SHIFT REGISTERS testrelay1 = 0; testrelay2 = 0; testrelay3 = 0; viewrelay = 256; viewrelay = (relay | viewrelay); viewrelay2 = 256; viewrelay2 = (relay2 | viewrelay2); viewrelay3 = 256; viewrelay3 = (relay3 | viewrelay3); /* unsigned long currentMillis = millis(); if(timereset==1) { if(currentMillis - previousMillis > interval) { // save the last time you blinked the LED previousMillis = currentMillis; pagenumber=0; timereset=0; } } */ //tempature sensor //getting the voltage reading from the temperature sensor int reading = analogRead(tempsensor); // converting that reading to voltage, for 3.3v arduino use 3.3 float voltage = reading * 5.0; voltage /= 1024.0; // now print out the temperature float temperatureC = (voltage - 0.5) * 100 ; //converting from 10 mv per degree wit 500 mV offset //to degrees ((volatge - 500mV) times 100 // now convert to Fahrenheight float temperatureF = ((temperatureC * 9.0 / 5.0) + 32); //lightsensor amblight = (analogRead(lightsensor) /5 ); if (amblight < amblighton) { amblightcurrent=1; } if (amblight > amblightoff) { amblightcurrent=0; } //PAGE 0 if (pagenumber==0) { // Print a message to the LCD. lcd.setCursor(0, 0); lcd.print(" 12:00:00 "); lcd.setCursor(0, 1); lcd.print(" 01/01/2011 "); lcd.setCursor(0, 2); lcd.print(" "); lcd.setCursor(0, 3); lcd.print(" "); lcd.print(temperatureF); lcd.print((char)223); lcd.print("F - "); lcd.print(temperatureC); lcd.print((char)223); lcd.print("C "); } //PAGE 1 if (pagenumber==1) { // Print a message to the LCD. lcd.print("POR ENGINE START"); lcd.setCursor(0, 1); lcd.print(" "); if (enginestart<1) { lcd.print("STARTING"); } else { lcd.print(" READY"); } if (por<1) { lcd.print("ON "); } else { lcd.print("OFF"); } lcd.setCursor(0, 2); lcd.print(" GARAGE "); lcd.setCursor(0, 3); if (garagelight<1) { lcd.print("!LIGHTS!"); } else { lcd.print(" LIGHTS "); } lcd.print(" "); if (garagedoor<1) { lcd.print("!DOOR!"); } else { lcd.print(" DOOR "); } } //PAGE 2 if (pagenumber==2) { // Print a message to the LCD. lcd.print("CB RADIO SCANNER"); lcd.setCursor(0, 1); if (cbradio<1) { lcd.print("ON "); } else { lcd.print("OFF"); } lcd.print(" "); if (scanner<1) { lcd.print(" ON"); } else { lcd.print("OFF"); } lcd.setCursor(0, 2); lcd.print("GPS INVERTER"); lcd.setCursor(0, 3); if (gps<1) { lcd.print("ON "); } else { lcd.print("OFF"); } lcd.print(" "); if (inverter<1) { lcd.print(" ON"); } else { lcd.print("OFF"); } } //PAGE 3 if (pagenumber==3) { // Print a message to the LCD. lcd.print("SIDE L FOG L"); lcd.setCursor(0, 1); if (sidelight<1) { lcd.print("ON "); } else { lcd.print("OFF"); } lcd.print(" "); if (foglight<1) { lcd.print(" ON"); } else { lcd.print("OFF"); } lcd.setCursor(0, 2); lcd.print("INTERIOR L LED L"); lcd.setCursor(0, 3); if (intlight<1) { lcd.print("ON "); } else { lcd.print("OFF"); } lcd.print(" "); if (ledintlight==0) { lcd.print(" ON"); } if (ledintlight==1) { lcd.print(" OFF"); } if (ledintlight==2) { lcd.print("AUTO"); } } //PAGE 4 if (pagenumber==4) { // Print a message to the LCD. lcd.print("DASH L "); lcd.setCursor(0, 1); if (dashlight==0) { lcd.print("ON "); } if (dashlight==1) { lcd.print("OFF "); } if (dashlight==2) { lcd.print("AUTO"); } lcd.print(" "); if (unused<1) { lcd.print(" "); } else { lcd.print(" "); } lcd.setCursor(0, 2); lcd.print("LOW BEAM DAY LIGHTS"); lcd.setCursor(0, 3); if (lowbeam==0) { lcd.print("ON "); } if (lowbeam==1) { lcd.print("OFF "); } if (lowbeam==2) { lcd.print("AUTO"); } lcd.print(" "); if (daylight==0) { lcd.print(" ON"); } if (daylight==1) { lcd.print(" OFF"); } if (daylight==2) { lcd.print("AUTO"); } } //PAGE 5 if (pagenumber==5) { // Print a message to the LCD. lcd.setCursor(0, 0); lcd.print(" Diagnostics "); lcd.setCursor(0, 1); lcd.print(" "); lcd.setCursor(0, 2); lcd.print(" "); lcd.setCursor(0, 3); lcd.print("Enter "); } //PAGE 19 if (pagenumber==19) { // Print a message to the LCD. lcd.print(" Diagnostics "); lcd.setCursor(0, 1); lcd.print(" "); lcd.setCursor(0, 2); lcd.print(" "); lcd.setCursor(0, 3); lcd.print(" Exit"); } //PAGE 20 if (pagenumber==20) { // Print a message to the LCD. lcd.print("ON Ambient Light OFF"); lcd.setCursor(0, 1); lcd.print("+5 +5"); lcd.setCursor(0, 2); lcd.print(" "); lcd.print(amblighton); lcd.print(" "); lcd.print(amblight); lcd.print(" "); lcd.setCursor(17, 2); lcd.print(amblightoff); lcd.print(" "); lcd.setCursor(0, 3); lcd.print("-5"); lcd.print(" "); if (amblightcurrent==1) { lcd.print(" ON"); } if (amblightcurrent==0) { lcd.print("OFF"); } lcd.print(" "); lcd.print("-5"); } //PAGE 21 if (pagenumber==21) { // Print a message to the LCD. lcd.setCursor(0, 0); lcd.print("Shift Registers ALL"); lcd.setCursor(0, 1); lcd.print("Reg #1 "); lcd.print(viewrelay3, BIN); lcd.print(" "); lcd.setCursor(0, 2); lcd.print("Reg #2 "); lcd.print(viewrelay, BIN); lcd.print(" "); lcd.setCursor(0, 3); lcd.print("Reg #3 "); lcd.print(viewrelay2, BIN); lcd.print(" "); } //PAGE 22 if (pagenumber==22) { // Print a message to the LCD. lcd.setCursor(0, 0); lcd.print(" TIME "); lcd.setCursor(0, 1); lcd.print(" 12:00:00 "); lcd.setCursor(0, 2); lcd.print(" 01/01/2011 "); lcd.setCursor(0, 3); lcd.print("Daylight Savings"); if (daylightsavings==1) lcd.print(" ON"); else lcd.print(" OFF"); } if (pagenumber==23) { // Print a message to the LCD. lcd.setCursor(0, 0); lcd.print(" Sensors "); lcd.setCursor(0, 1); lcd.print("amblight = "); lcd.print(analogRead(lightsensor)); lcd.setCursor(16, 1); lcd.print(" "); lcd.setCursor(0, 2); lcd.print("temp = "); lcd.print(analogRead(tempsensor)); lcd.print(" "); lcd.setCursor(0, 3); lcd.print(" "); } //PAGE 24 if (pagenumber==24) { // Print a message to the LCD. lcd.print("RELAY FAN "); lcd.setCursor(0, 1); if (relayfan<1) { lcd.print("ON "); } else { lcd.print("OFF"); } lcd.print(" "); lcd.setCursor(0, 2); lcd.print(" "); lcd.setCursor(0, 3); lcd.print(" "); } reading = digitalRead(nextbuttonpin); // if the input just went from LOW and HIGH and we've waited long enough // to ignore any noise on the circuit, toggle the output pin and remember // the time if (reading==1 && previous==0 && millis() - time > debounce) { pagenumber = (pagenumber+1); if (pagenumber==6) pagenumber = 0; if (pagenumber==25) pagenumber = 19; time = millis(); } previous = reading; reading = digitalRead(prevbuttonpin); // if the input just went from LOW and HIGH and we've waited long enough // to ignore any noise on the circuit, toggle the output pin and remember // the time if (reading==1 && previous==0 && millis() - time > debounce) { pagenumber = (pagenumber-1); if (pagenumber==-1) pagenumber = 5; if (pagenumber==18) pagenumber = 24; time = millis(); } previous = reading; //BUTTON 1 reading = analogRead(button1pin); // if the input just went from LOW and HIGH and we've waited long enough // to ignore any noise on the circuit, toggle the output pin and remember // the time if (reading > 120 && previous < 120 && millis() - time > debounce) { if (pagenumber==1) if (por == 1) por = 0; else por = 1; if (pagenumber==2) if (cbradio == 1) cbradio = 0; else cbradio = 1; if (pagenumber==3) if (sidelight == 1) sidelight = 0; else sidelight = 1; if (pagenumber==4) dashlight = (dashlight + 1); if (dashlight==3) dashlight=0; if (pagenumber==20) { amblighton = (amblighton + 5); EEPROM.write(2, amblighton); } if (pagenumber==21) { testrelay1=1; testregisters1(); } if (pagenumber==24) if (relayfan == 1) relayfan = 0; else relayfan = 1; time = millis(); } previous = reading; //BUTTON 2 reading = analogRead(button2pin); //MOMENTARY if (pagenumber==1) if (reading > 120) enginestart = 0; else enginestart = 1; // if the input just went from LOW and HIGH and we've waited long enough // to ignore any noise on the circuit, toggle the output pin and remember // the time if (reading > 120 && previous < 120 && millis() - time > debounce) { if (pagenumber==2) if (scanner == 1) scanner = 0; else scanner = 1; if (pagenumber==3) if (foglight == 1) foglight = 0; else foglight = 1; if (pagenumber==4) if (unused == 1) unused = 0; else unused = 1; if (pagenumber==20) { amblightoff = (amblightoff + 5); EEPROM.write(1, amblightoff); } if (pagenumber==21) if (testallrelay == 1) testallrelay = 0; else testallrelay = 1; time = millis(); } previous = reading; //BUTTON 3 reading = analogRead(button3pin); //MOMENTARY if (pagenumber==1) if (reading > 1000) garagelight = 0; else garagelight = 1; // if the input just went from LOW and HIGH and we've waited long enough // to ignore any noise on the circuit, toggle the output pin and remember // the time if (reading > 1000 && previous < 1000 && millis() - time > debounce) { if (pagenumber==2) if (gps == 1) gps = 0; else gps = 1; if (pagenumber==3) if (intlight == 1) intlight = 0; else intlight = 1; if (pagenumber==4) lowbeam = (lowbeam + 1); if (lowbeam==3) lowbeam=0; if (pagenumber==5) pagenumber=19; if (pagenumber==20) { amblighton = (amblighton - 5); EEPROM.write(2, amblighton); } if (pagenumber==21) { testrelay2=1; testregisters2(); } time = millis(); } previous = reading; //BUTTON 4 reading = analogRead(button4pin); //MOMENTARY if (pagenumber==1) if (reading > 120) garagedoor = 0; else garagedoor = 1; // if the input just went from LOW and HIGH and we've waited long enough // to ignore any noise on the circuit, toggle the output pin and remember // the time if (reading > 120 && previous < 120 && millis() - time > debounce) { if (pagenumber==2) if (inverter == 1) inverter = 0; else inverter = 1; if (pagenumber==3) ledintlight = (ledintlight + 1); if (ledintlight==3) ledintlight=0; if (pagenumber==4) daylight = (daylight + 1); if (daylight==3) daylight=0; if (pagenumber==19) pagenumber=0; if (pagenumber==20) { amblightoff = (amblightoff - 5); EEPROM.write(1, amblightoff); } if (pagenumber==21){ testrelay3=1; testregisters3(); } if (pagenumber==22) if (daylightsavings == 1) daylightsavings = 0; else daylightsavings = 1; EEPROM.write(3, daylightsavings); time = millis(); } previous = reading; //FOR SHIFT REGISTER if (cbradio==1) { { updateLEDs(relay = ((relay & ~1))); } } if (cbradio==0) { { updateLEDs(relay = (relay | 1)); } } if (scanner==1) { { updateLEDs(relay = ((relay & ~2))); } } if (scanner==0) { { updateLEDs(relay = (relay | 2)); } } if (gps==1) { { updateLEDs(relay = ((relay & ~4))); } } if (gps==0) { { updateLEDs(relay = (relay | 4)); } } if (inverter==1) { { updateLEDs(relay = ((relay & ~8))); } } if (inverter==0) { { updateLEDs(relay = (relay | 8)); } } if (sidelight==1) { { updateLEDs(relay = ((relay & ~16))); } } if (sidelight==0) { { updateLEDs(relay = (relay | 16)); } } if (foglight==1) { { updateLEDs(relay = ((relay & ~32))); } } if (foglight==0) { { updateLEDs(relay = (relay | 32)); } } if (intlight==1) { { updateLEDs(relay = ((relay & ~64))); } } if (intlight==0) { { updateLEDs(relay = (relay | 64)); } } if (ledintlight==1) { { updateLEDs(relay = ((relay & ~128))); } } if (ledintlight==0) { { updateLEDs(relay = (relay | 128)); } } if (ledintlight==2) { if(amblight > amblightoff) { updateLEDs(relay = ((relay & ~128))); } if(amblight < amblighton) { updateLEDs(relay = (relay | 128)); } } if (por==1) { { updateLEDs(relay2 = ((relay2 & ~1))); } } if (por==0) { { updateLEDs(relay2 = (relay2 | 1)); } } if (enginestart==1) { { updateLEDs(relay2 = ((relay2 & ~2))); } } if (enginestart==0) { { updateLEDs(relay2 = (relay2 | 2)); } } if (test11==1) { { updateLEDs(relay2 = ((relay2 & ~4))); } } if (test11==0) { { updateLEDs(relay2 = (relay2 | 4)); } } if (test12==1) { { updateLEDs(relay2 = ((relay2 & ~8))); } } if (test12==0) { { updateLEDs(relay2 = (relay2 | 8)); } } if (relayfan==1) { { updateLEDs(relay2 = ((relay2 & ~16))); } } if (relayfan==0) { { updateLEDs(relay2 = (relay2 | 16)); } } if (dashlight==1) { { updateLEDs(relay2 = ((relay2 & ~32))); } } if (dashlight==0) { { updateLEDs(relay2 = (relay2 | 32)); } } if (dashlight==2) { if(amblight > amblightoff) { updateLEDs(relay2 = ((relay2 & ~32))); } if(amblight < amblighton) { updateLEDs(relay2 = (relay2 | 32)); } } if (lowbeam==1) { { updateLEDs(relay2 = ((relay2 & ~64))); } } if (lowbeam==0) { { updateLEDs(relay2 = (relay2 | 64)); } } if (lowbeam==2) { if(amblight > amblightoff) { updateLEDs(relay2 = ((relay2 & ~64))); } if(amblight < amblighton) { updateLEDs(relay2 = (relay2 | 64)); } } if (daylight==1) { { updateLEDs(relay2 = ((relay2 & ~128))); } } if (daylight==0) { { updateLEDs(relay2 = (relay2 | 128)); } } if (daylight==2) { if(amblight > amblightoff) { updateLEDs(relay2 = ((relay2 & ~128))); } if(amblight < amblighton) { updateLEDs(relay2 = (relay2 | 128)); } } if (garagedoor==1) { { updateLEDs(relay3 = ((relay3 & ~1))); } } if (garagedoor==0) { { updateLEDs(relay3 = (relay3 | 1)); } } if (garagelight==1) { { updateLEDs(relay3 = ((relay3 & ~2))); } } if (garagelight==0) { { updateLEDs(relay3 = (relay3 | 2)); } } if (test19==1) { { updateLEDs(relay3 = ((relay3 & ~4))); } } if (test19==0) { { updateLEDs(relay3 = (relay3 | 4)); } } if (test20==1) { { updateLEDs(relay3 = ((relay3 & ~8))); } } if (test20==0) { { updateLEDs(relay3 = (relay3 | 8)); } } if (test21==1) { { updateLEDs(relay3 = ((relay3 & ~16))); } } if (test21==0) { { updateLEDs(relay3 = (relay3 | 16)); } } if (test22==1) { { updateLEDs(relay3 = ((relay3 & ~32))); } } if (test22==0) { { updateLEDs(relay3 = (relay3 | 32)); } } if (test23==1) { { updateLEDs(relay3 = ((relay3 & ~64))); } } if (test23==0) { { updateLEDs(relay3 = (relay3 | 64)); } } if (test24==1) { { updateLEDs(relay3 = ((relay3 & ~128))); } } if (test24==0) { { updateLEDs(relay3 = (relay3 | 128)); } } while (testallrelay==1) { digitalWrite(latch, LOW); shiftOut(data, clock, MSBFIRST, 255); //Shifts out the 8 bits to the shift register shiftOut(data, clock, MSBFIRST, 255); shiftOut(data, clock, MSBFIRST, 255); //Shifts out the 8 bits to the shift register digitalWrite(latch, HIGH); reading = analogRead(button2pin); // if the input just went from LOW and HIGH and we've waited long enough // to ignore any noise on the circuit, toggle the output pin and remember // the time if (reading > 120 && previous < 120 && millis() - time > debounce) { testallrelay=0; time = millis(); } previous = reading; } } /* * updateLEDs() - sends the LED states set in ledStates to the 74HC595 * sequence */ void updateLEDs(int value){ digitalWrite(latch, LOW); //Pulls the chips latch low shiftOut(data, clock, MSBFIRST, relay2); //Shifts out the 8 bits to the shift register shiftOut(data, clock, MSBFIRST, relay); //Shifts out the 8 bits to the shift register shiftOut(data, clock, MSBFIRST, relay3); //Shifts out the 8 bits to the shift register digitalWrite(latch, HIGH); //Pulls the latch high displaying the data } void testregisters1() { digitalWrite(latch, LOW); shiftOut(data, clock, MSBFIRST, testrelay3); //Shifts out the 8 bits to the shift register shiftOut(data, clock, MSBFIRST, testrelay2); shiftOut(data, clock, MSBFIRST, testrelay1); //Shifts out the 8 bits to the shift register digitalWrite(latch, HIGH); delay(2000); for (int x=0; x<7; x++) { testrelay1 = (testrelay1 * 2); digitalWrite(latch, LOW); shiftOut(data, clock, MSBFIRST, testrelay3); //Shifts out the 8 bits to the shift register shiftOut(data, clock, MSBFIRST, testrelay2); shiftOut(data, clock, MSBFIRST, testrelay1); //Shifts out the 8 bits to the shift register digitalWrite(latch, HIGH); delay(2000); } } void testregisters2() { digitalWrite(latch, LOW); shiftOut(data, clock, MSBFIRST, testrelay3); //Shifts out the 8 bits to the shift register shiftOut(data, clock, MSBFIRST, testrelay2); shiftOut(data, clock, MSBFIRST, testrelay1); //Shifts out the 8 bits to the shift register digitalWrite(latch, HIGH); delay(2000); for (int x=0; x<7; x++) { testrelay2 = (testrelay2 * 2); digitalWrite(latch, LOW); shiftOut(data, clock, MSBFIRST, testrelay3); //Shifts out the 8 bits to the shift register shiftOut(data, clock, MSBFIRST, testrelay2); shiftOut(data, clock, MSBFIRST, testrelay1); //Shifts out the 8 bits to the shift register digitalWrite(latch, HIGH); delay(2000); } } void testregisters3() { testrelay1=0; testrelay2=0; testrelay3=1; digitalWrite(latch, LOW); shiftOut(data, clock, MSBFIRST, testrelay3); //Shifts out the 8 bits to the shift register shiftOut(data, clock, MSBFIRST, testrelay2); shiftOut(data, clock, MSBFIRST, testrelay1); //Shifts out the 8 bits to the shift register digitalWrite(latch, HIGH); delay(2000); for (int x=0; x<7; x++) { testrelay3 = (testrelay3 * 2); digitalWrite(latch, LOW); shiftOut(data, clock, MSBFIRST, testrelay3); shiftOut(data, clock, MSBFIRST, testrelay2); //Shifts out the 8 bits to the shift register shiftOut(data, clock, MSBFIRST, testrelay1); //Shifts out the 8 bits to the shift register digitalWrite(latch, HIGH); delay(2000); } } void testregistersall() { testrelay1=255; testrelay2=255; testrelay3=255; digitalWrite(latch, LOW); shiftOut(data, clock, MSBFIRST, testrelay3); //Shifts out the 8 bits to the shift register shiftOut(data, clock, MSBFIRST, testrelay2); shiftOut(data, clock, MSBFIRST, testrelay1); //Shifts out the 8 bits to the shift register digitalWrite(latch, HIGH); delay(2000); } // lcd.setCursor(0, 4); // set the cursor to column 0, line 1 // (note: line 1 is the second row, since counting begins with 0): // lcd.setCursor(0, 1); // print the number of seconds since reset: // lcd.print(millis()/1000);