Use the internal pullup to be able to hook up this sketch directly to an energy meter with S0 output

If no pullup is used, the reported usage will be too high because of the floating pin
This commit is contained in:
Marco Noord
2016-01-13 17:19:59 +01:00
parent 74a54267d2
commit a6569c884a
@@ -70,6 +70,10 @@ void setup()
{
// Fetch last known pulse count value from gw
request(CHILD_ID, V_VAR1);
// Use the internal pullup to be able to hook up this sketch directly to an energy meter with S0 output
// If no pullup is used, the reported usage will be too high because of the floating pin
digitalWrite(DIGITAL_INPUT_SENSOR,HIGH);
attachInterrupt(INTERRUPT, onPulse, RISING);
lastSend=millis();