It only gives me short pulses, and not for 1 second, as expected.
If I remove clearWatch (ht.watch), I get a short pulse, then full pulse length and it uses all the memory.
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.
Ok, time to bring the toys back.
With this test I have set a LED to pin, active low.
First test.
It only gives me short pulses, and not for 1 second, as expected.
If I remove clearWatch (ht.watch), I get a short pulse, then full pulse length and it uses all the memory.
On esp8266 there are no problems.
Next test.
Here pinMode has been moved to after set_Watch and I can determine pulse length on LED.
Also works on esp8266.
And now for a workaround, so it works on both esp8266 and esp32 pico4 as I have.
Hope this is something you can use?
And some outputs.
Happy coding.