Then D1 will be debounced so senderase is not called unless D1 is high for at least 50ms.
On puck2 I'm not sure what you're trying to do? That is basically the same as writing analogWrite(D1,1) directly onto puck1.
In that case, since you're writing an analog value that is just 1, it's the same as digitalWrite(D1,1). It turns D1 into an output and sets it to 1 - which I guess will cause senderase to be called if D1 wasn't set previously - but since D1 is now an output it won't respond to external inputs any more
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Sorry, I still don't understand...
If you do:
Then
D1
will be debounced sosenderase
is not called unlessD1
is high for at least 50ms.On puck2 I'm not sure what you're trying to do? That is basically the same as writing
analogWrite(D1,1)
directly onto puck1.In that case, since you're writing an analog value that is just 1, it's the same as
digitalWrite(D1,1)
. It turns D1 into an output and sets it to 1 - which I guess will causesenderase
to be called if D1 wasn't set previously - but since D1 is now an output it won't respond to external inputs any more