When you tell it to write 256 (for example), this function does not
really write 256. Instead, it writes a lot of different numbers,
and their average is 256.
Analog Write Pin
Write an analog signal (0 through 1023) to the
pin you say.
pins.analogWritePin(AnalogPin.P0, 400)
Parameters
nameis a string that is the pin name you say (P0throughP4, orP10)valueis a number from0through1023
Example
This program writes 1023 to pin P0.
pins.analogWritePin(AnalogPin.P0, 1023)
See also
micro:bit pins, on pin pressed, analog read pin, digital read pin, digital write pin