-
• #2
digitalPulse
only takes 3 arguments, so withdigitalPulse(B3, 1, 0.10, 0.1)
the final argument is ignored - it's like sayingdigitalPulse(B3, 1, 0.10)
When you pass an array, you're passing
[on,off,on,off,...
- so if you pass an odd number of arguments the pin will return to its initial state (in your case 0), but if you pass an even number of arguments it'll finish at 1 - does that help? -
• #3
Definitely, yes. Thanks for the explanation :)
On a Pico with v1.91 I can do
digitalPulse(B3, 1, 0.10, 0.1)
to get a short pulse of 0.1ms length, with the pin returning to 0 at the end. I'm expecting the same fordigitalPulse(B3, 1, [0.1, 0.1])
.However, when passing the lengths as array the pin state is finally 1.
What am I missing here?