Could you look over the code for any glaring errors? I'm sure there are a bunch. I'm still very new at programming for arduino.
Thanks
/*
setup is as follows. Older washer and dryer wish mechanical round timers. Probe timer for 120vac.
Connect 5vdc wall wart so when machine is one its outting out 5vdc. Use the wall wart to power a Solid State Relay with
dc output, run dc from arduino regulated power thru it to sensor pin. Then I can use a 2N222 or
similar to turn on another bigger solid state relay to power my LED status indicators.
*/
int loopDelay = 1000; // loop delay between readings set by user
const int LEDpin = 13; // output pin for on board LED
const int dryerlitePin = 5; // dryer lite trigger output pin
const int washerlitePin = 4; // washer lite trigger output pin
const int dryerPin = 2; // dryer sensor pin
const int washerPin = 3; // washer sensor pin
int dryerState = 0; // current state of the dryer, set to zero=off
int washerState = 0; // current state of the washer, set to zero=off
int lastDryerState = 0; // previous state of the dryer, set to zero=off
int lastWasherState = 0; // previous state of the washer, set to zero=offvoid setup()
{
pinMode(LEDpin,OUTPUT); // initialize LED pin as output for user monitoring
digitalWrite(LEDpin,LOW); // set LED off
pinMode(dryerlitePin, OUTPUT); // initialize the dryer lite pin as an output
digitalWrite(dryerlitePin,LOW); // set the dryerer lite pin LOW (lite off)
pinMode(washerlitePin, OUTPUT); // initialize the washer lite pin as an output
digitalWrite(washerlitePin,LOW); // set the washer lite pin LOW (lite off)
pinMode(dryerPin, INPUT); // initialize the dryer pin as an input from hall switch
pinMode(washerPin, INPUT); // initialize the washer pin as an input from hall switch
}
void loop()
{
digitalWrite(LEDpin,HIGH); // flash Green LED to indicate loop is active
delay(20);
digitalWrite(LEDpin,LOW);
{
//begin dryer readings
if (dryerPin == LOW) digitalWrite(dryerlitePin, HIGH); // check if power is coming from dryer if not switch on dryer done lite
//User will need to reset.//end of dryer readings
}
{
//begin washer readings
if (dryerPin == LOW) digitalWrite(washerlitePin, HIGH); // check if power is coming from dryer if not switch on dryer done lite
//User will need to reset.
}
//end of washer readings
delay (loopDelay); // optional delay set by user
}