sorry my code was so long the website wouldnt allow it so here is the second half
if(pressCount != lastpresscount || selectCount != lastselectcount )
{
if(pressCount == 1)
{
if(selectCount == 1)
{
lcd.setCursor(7,1);
lcd.print("OFF");
windshieldstatus=LOW;
windshieldonoff1 = LOW;
windshieldonoff2 = LOW;
}
if(selectCount == 2)
{
lcd.setCursor(7,1);
lcd.print("IN1");
windshieldonoff1 = HIGH;
windshieldonoff2 = LOW;
}
if(selectCount == 3)
{
lcd.setCursor(7,1);
lcd.print("IN2");
windshieldonoff2 = HIGH;
windshieldonoff1 = LOW;
}
if(selectCount == 4)
{
lcd.setCursor(7,1);
lcd.print(" ON");
windshieldstatus = HIGH;
windshieldonoff1 = LOW;
windshieldonoff2 = LOW;
}
if(selectCount > 4)
{
selectCount = 0;
}
windshieldmode = selectCount;
}
if(pressCount == 2)
{
if(selectCount == 1){
lcd.setCursor(7,1);
lcd.print("OFF");
digitalWrite(frontlightspower ,LOW);
}
if(selectCount == 2)
{
lcd.setCursor(7,1);
lcd.print(" ON");
digitalWrite(frontlightspower ,HIGH);
}
if(selectCount > 2)
{
selectCount = 0;
}
frontlightsmode = selectCount;
}
if(pressCount == 3)
{
if(selectCount == 1)
{
lcd.setCursor(7,1);
lcd.print("OFF");
rearlightoff=HIGH;
rearlighton=LOW;
rearlighttemp=LOW;
}
if(selectCount == 2)
{
lcd.setCursor(7,1);
lcd.print("TMP");
rearlighttemp = HIGH;
rearlighton=LOW;
rearlightoff=LOW;
}
if(selectCount == 3)
{
lcd.setCursor(7,1);
lcd.print(" ON");
rearlighton = HIGH ;
rearlightoff=LOW;
rearlighttemp=LOW;
}
if(selectCount > 3)
{
selectCount = 0;
}
rearlightmode = selectCount;
}
if(pressCount == 4)
{
if(selectCount == 1)
{
lcd.setCursor(7,1);
lcd.print("OFF");
radiooff = HIGH ;
radioon = LOW;
radioacc = LOW;
}
if(selectCount == 2)
{
lcd.setCursor(7,1);
lcd.print("ACC");
radioacc = HIGH;
radioon= LOW;
radiooff= LOW;
}
if(selectCount == 3)
{
lcd.setCursor(7,1);
lcd.print(" ON");
radioon = HIGH;
radiooff= LOW;
radioacc = LOW;
}
else
{
radioon = LOW;
}
if(selectCount > 3)
{
selectCount = 0;
}
radiomode = selectCount;
}
if(pressCount == 5)
{
if(selectCount == 1)
{
lcd.setCursor(7,1);
lcd.print("OFF");
digitalWrite(flashlightpower ,LOW);
}
if(selectCount == 2)
{
lcd.setCursor(7,1);
lcd.print(" ON");
digitalWrite(flashlightpower ,HIGH);
}
if(selectCount > 2)
{
selectCount = 0;
}
flashlightmode = selectCount;
}
if(pressCount == 6)
{
if(selectCount == 1){
lcd.setCursor(7,1);
lcd.print("OFF");
digitalWrite(hampower ,LOW);
}
if(selectCount == 2)
{
lcd.setCursor(7,1);
lcd.print(" ON");
digitalWrite(hampower ,HIGH);
}
if(selectCount > 2)
{
selectCount = 0;
}
hammode = selectCount;
}
if(pressCount == 7)
{
if(selectCount == 1)
{
lcd.setCursor(7,1);
lcd.print("DWN");
antennadown = HIGH;
antennaup= LOW;
}
if(selectCount == 2)
{
lcd.setCursor(7,1);
lcd.print(" UP");
antennaup= HIGH;
antennadown= LOW;
}
if(selectCount > 2)
{
selectCount = 0;
}
antennamode = selectCount;
}
}
//windsheildfuntion...............................................
if(windshieldonoff1 == HIGH)
{
if(timer < 7000)
{
windshieldstatus=LOW ;
}
if(timer > 7000)
{
windshieldstatus = HIGH;
}
}
if(windshieldonoff2 == HIGH)
{
if(timer < 4000)
{
windshieldstatus=LOW ;
}
if(timer > 4000)
{
windshieldstatus = HIGH;
}
}
digitalWrite(windshieldpower,windshieldstatus);
// Rear light function.......................................
if(rearlighton==HIGH)
{
digitalWrite(rearlightpower,HIGH);
}
if(rearlighttemp == HIGH)
{
digitalWrite(rearlightpower,HIGH);
delaytimer = currentMillis;
delay(1000);
rearlighttemp = LOW;
}
if(rearlightwait > 180000 && rearlighton== LOW)
{
digitalWrite(rearlightpower, LOW);
}
if (rearlightoff==HIGH)
{
digitalWrite(rearlightpower,LOW);
}
rearlightwait= currentMillis - delaytimer;
//radio funtion.................................
if (radioacc == HIGH && accmode == HIGH)
{
digitalWrite(radiopower, HIGH);
}
if (radioacc == HIGH && accmode == LOW)
{
digitalWrite(radiopower, LOW);
}
if (radioon == HIGH)
{
digitalWrite(radiopower, HIGH);
}
if (radiooff == HIGH)
{
digitalWrite(radiopower, LOW);
}
//antenna function...............................
if(antennaup == HIGH)
{
digitalWrite(antennauppower,HIGH);
digitalWrite(antennadownpower, LOW);
delaytimer2 = millis();
antennaup = LOW;
}
if(antennadown == HIGH)
{
digitalWrite(antennadownpower, HIGH);
digitalWrite(antennauppower,LOW);
delaytimer2 = millis();
antennadown = LOW;
}
if(antennadelay > 10800000 && antennadelay < 10805000)
{
digitalWrite(antennadownpower, HIGH);
delay(9000);
digitalWrite(antennadownpower, LOW);
}
if(antennadelay > 9000)
{
digitalWrite(antennadownpower, LOW);
digitalWrite(antennauppower,LOW);
}
antennadelay=currentMillis-delaytimer2;
accmode=digitalRead(acc);
lastselectcount = selectCount;
lastpresscount = pressCount;
}