Hi just saw this and am working on a similar project
my jeep has a lot of extra features plus some things that i had to cheaply replace (like the windshield wipers broke and it would be expensive to replace the switch system)
anyway my project just uses a small lcd screen and two buttons to navigate through a menu. not as cool as a touch screen but you might be able to barrow some of my code or use my idea. cost is pretty low. just lcd, relay, arduino mega and two buttons.
its is not complete yet because while i was doing the final touches on the project i think i fried my arduino and am waiting for a new one. hahaha. im a newbie i know.
anyways here is my code seems to work although maybe overly complicated, i dont know im not that good.
const int pushButtonPin = 50; //button that will swithch between modes, like windsheld wippers, and rearlight
const int selector = 51; // button that will change the settings of each modewindshieldpower
int pressCount = 0;
int selectCount = 0;
int windshieldpower = 38; // i want this to be able have to ability to be on / off / and intermittently on so that
int frontlightspower = 50;
int rearlightpower = 36;
int radiopower = 40;
int flashlightpower = 42;
int hampower = 44;
int antennauppower = 46; //antenna up and down is seperate because the factory motor has a seperate wire for moving up and moving down
int antennadownpower = 48;
int acc = 30;
int prevState = LOW; //part of debounce/counter for the mode button
int currState;
int prevState2 = LOW; //part of dedbounce/ coutner for the selector button
int currState2;
#include <Wire.h>
#include <LiquidCrystal.h> // include LCD library
#define LCD_BACKLIGHT_OFF() digitalWrite( LCD_BACKLIGHT_PIN, LOW )
#define LCD_BACKLIGHT_ON() digitalWrite( LCD_BACKLIGHT_PIN, HIGH )
#define LCD_BACKLIGHT(state) { if( state ){digitalWrite( LCD_BACKLIGHT_PIN, HIGH );}else{digitalWrite( LCD_BACKLIGHT_PIN, LOW );} }
byte buttonJustPressed = false; //this will be true after a ReadButtons() call if triggered
byte buttonJustReleased = false; //this will be true after a ReadButtons() call if triggered
LiquidCrystal lcd( 8, 9, 4, 5, 6, 7 );
int lastpresscount = 0;
int lastselectcount =0;
int windshieldmode = 0;
int frontlightsmode = 0;
int rearlightmode = 0;
int radiomode = 0;
int flashlightmode = 0;
int hammode = 0;
int antennamode = 0;
int windshieldonoff1 = LOW;
int windshieldonoff2 = LOW;
int windshieldstatus=LOW ;
int rearlighton = LOW;
long int delaytimer = 0;
long int rearlightwait = 0;
int rearlightoff = LOW;
int rearlighttemp = LOW;
int radiooff = LOW;
int radioon = LOW;
int radioacc = LOW;
int antennaup = LOW;
int antennadown = LOW;
long int antennadelay = 0;
long int delaytimer2 = 0;
long int delaytimer3 = 0;
int accmode = LOW;
long int timer = 0;
long previousMillis = 0;
void setup()
{
pinMode(22,OUTPUT);
digitalWrite(22,HIGH);
lcd.begin( 16, 2 );
lcd.setCursor( 1, 0 );
lcd.print( "SCOUT CONTROL" );
//
lcd.setCursor( 5, 1 );
lcd.print( "Ready" );
pinMode(pushButtonPin, INPUT);
digitalRead(pushButtonPin);
// digitalWrite(pushButtonPin, OUTPUT);
pinMode(selector, INPUT);
digitalRead(selector);
//digitalWrite(selector, OUTPUT);
pinMode(acc,INPUT);
digitalRead(acc);
pinMode(windshieldpower, OUTPUT);
pinMode(frontlightspower, OUTPUT);
pinMode(rearlightpower, OUTPUT);
pinMode(radiopower , OUTPUT);
pinMode(flashlightpower , OUTPUT);
pinMode(hampower , OUTPUT);
pinMode(antennauppower, OUTPUT);
pinMode(antennadownpower, OUTPUT);
Serial.begin(9600);
}
void loop()
{
unsigned long currentMillis = millis();
timer = currentMillis - previousMillis;
if(currentMillis - previousMillis > 10000) {
previousMillis = currentMillis;
}
currState = digitalRead(pushButtonPin);
if (currState != prevState)
{
if (currState == HIGH)
{
pressCount++;
}
delay(1);
}
prevState = currState;
currState2 = digitalRead(selector);
if (currState2 != prevState2)
{
if (currState2 == HIGH)
{
selectCount++;
}
delay(1);
}
prevState2 = currState2;
if(pressCount > 9)
{
pressCount = 0;
}
if(pressCount != lastpresscount)
{
if(pressCount == 1)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("windsheild");
lcd.setCursor(0,1);
lcd.print("Mode:");
selectCount = windshieldmode;
}
if(pressCount == 2)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("frontlights");
lcd.setCursor(0,1);
lcd.print("Mode:");
selectCount = frontlightsmode;
}
if(pressCount == 3)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("rearlight");
lcd.setCursor(0,1);
lcd.print("Mode:");
selectCount = rearlightmode;
}
if(pressCount == 4)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("radio");
lcd.setCursor(0,1);
lcd.print("Mode:");
selectCount = radiomode;
}
if(pressCount == 5)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("flashlight");
lcd.setCursor(0,1);
lcd.print("Mode:");
selectCount = flashlightmode;
}
if(pressCount == 6)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("HAM");
lcd.setCursor(0,1);
lcd.print("Mode:");
selectCount = hammode;
}
if(pressCount == 7){
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Antenna");
lcd.setCursor(0,1);
lcd.print("Mode:");
selectCount = antennamode;
}
if(pressCount == 0)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Scout Control");
}
}
Serial.println();