I'm trying to set the pin A0 to a certain DC Level, but it doesn't work.
I'm expecting the A0 pin to generate a constant DC voltage of 0-3,3V, depending on the value 0-1023 of the analogWrite() method.
Below is my example code.
The unexpected result is: A0 does NOT output 3,3V and the LEDs don't even blink until I remove the call to analogWrite().
What am I doing wrong?
Code: Select all
let heartbeat = false
forever(function () {
pins.A0.analogWrite(1023)
heartbeat = !(heartbeat)
if (heartbeat) {
light.setAll(0xffff00)
} else {
light.setAll(0x000000)
}
pause(500)
})