emonGLCD V1.3 Switches - fix!
It turns out that this error can be fixed in software. The switches can be made to work with no hardware modifications. The emonGLCD tester sketch has been updated with the required fix.
Here are the details:
The push switches are connected ADC 1,2 and 5 (digital 15,16 and 19). When pressed they are pulled low through resistor R5.
The Atmega328 has internal pull-up resistors (20K) which can be enabled by setting the port as output and doing a high digital write:
The switches are active low, meaning a logic 0 will be read on digital 15,16 and 19 when the relevant switch is pressed.
pinMode(switchpin, INPUT);
digitalWrite(switchpin, HIGH);
Thanks to forum member Drsdre for bringing this elegant fix to our attention. This is a real open-hardware success story! If you've bought an emonGLCD from us we will send out on request the three switches to be added free of charge.
We have created an item for the extra switches in the shop, just click buy (it's free) and quote your original order number: http://shop.openenergymonitor.com/displays/
All emonGLCD kits bought from the shop from now on will include the switches.
Happy days.