loading
1 Comments

Tell us about yourself!

Complete Your Profile
  • Home automation with arduino, buttons ,LCD ,EEPROM AND Smart Phone

    Do it really works, those buttons.. Because your code says:if (digitalRead(switchPin[0]) == LOW) { // switch is pressed - pullup keeps pin high normally digitalWrite(ch1, HIGH) ; lcd.setCursor(0, 0); lcd.print("r1 ON"); EEPROM.write(0, 1); } if (digitalRead(switchPin[0]) == LOW) { // switch is pressed - pullup keeps pin high normally digitalWrite(ch1, LOW) ; lcd.setCursor(0, 0); lcd.print("r1 OFF"); EEPROM.write(0, 0); }If I press button 1, first 'if' catch it.. Ok.. After that if {...} button is still down and second 'if' is true too.. So, first we set relay to ON and right after we turn it OFF..You should have something like:if (digitalRead(switchPin[0]) == LOW && pin0 == false) { pin0=true};if (digitalRead(switchPin[0])...see more »Do it really works, those buttons.. Because your code says:if (digitalRead(switchPin[0]) == LOW) { // switch is pressed - pullup keeps pin high normally digitalWrite(ch1, HIGH) ; lcd.setCursor(0, 0); lcd.print("r1 ON"); EEPROM.write(0, 1); } if (digitalRead(switchPin[0]) == LOW) { // switch is pressed - pullup keeps pin high normally digitalWrite(ch1, LOW) ; lcd.setCursor(0, 0); lcd.print("r1 OFF"); EEPROM.write(0, 0); }If I press button 1, first 'if' catch it.. Ok.. After that if {...} button is still down and second 'if' is true too.. So, first we set relay to ON and right after we turn it OFF..You should have something like:if (digitalRead(switchPin[0]) == LOW && pin0 == false) { pin0=true};if (digitalRead(switchPin[0]) == HIGH && pin0 == true) { pin0=false; pin0status=pin0status==HIGH?LOW:HIGH; digitalWrite(ch1,pin0status); // do rest of stuff...}

    View Instructable »