You are reading a single comment by @Robin and its replies.
Click here to read the full conversation.
-
Mon 2019.04.08
'If you really are using a Pico, D0 is not a valid pin'
Fantastic catch @Gordon, totally missed that. . . .
Mon 2019.04.08
'If you really are using a Pico, D0 is not a valid pin'
Fantastic catch @Gordon, totally missed that. . . .
Hi Sam!
That's a great idea - I've been meaning to try something like that.
If you really are using a Pico,
D0
is not a valid pin (https://www.espruino.com/Pico#pinout). Which pin did you think you were connecting to?If I'm reading your post right, it's really the
setWatch
that's not firing reliably? So you could remove all your code and just doAnd see what happens? Having the debounce probably won't help you.
The 40k internal vs 2k resistance sounds like it would be fine. Are you sure that you have your LED attached to the light sensor in such a way that no light from anywhere else is getting in? If it was, it could mean the light sensor always have a reading that there was light.
@Robin :
The pulses of LEDs in UK electricity meters are quite fast - polling every 0.5 seconds won't do it. You'd need to do it 1000 times a sec to be even remotely sure.
No, afraid not. Like in all of the Espruino examples, you just use a pin name as-is, eg
D0
- not quoted or a hex number.