Babak asked to add a low power LED to warn the users. The LED is wired via a 74AC04N from pin 4. If the voltage goes bellow 12v, it will blink for a 100ms every second.
I also fixed the conversion of the analog value to match actual volts ( https://www.arduino.cc/en/Tutorial/ReadAnalogVoltage ) and tested it. On my rig, it reports 12.12V for 12.7 V , the discrepancy is coming from the voltage divider resistor tolerance.
The 74AC04N will also drive 2 LEDs for the open and close positions as requested by Babak but has no impact to the code as it's all done in hardware on the future new shield
Babak asked to add a low power LED to warn the users. The LED is wired via a 74AC04N from pin 4. If the voltage goes bellow 12v, it will blink for a 100ms every second. I also fixed the conversion of the analog value to match actual volts ( https://www.arduino.cc/en/Tutorial/ReadAnalogVoltage ) and tested it. On my rig, it reports 12.12V for 12.7 V , the discrepancy is coming from the voltage divider resistor tolerance. The 74AC04N will also drive 2 LEDs for the open and close positions as requested by Babak but has no impact to the code as it's all done in hardware on the future new shield