Skip to content
This repository was archived by the owner on Sep 10, 2022. It is now read-only.

Analog Write

Alan Yorinks edited this page Mar 11, 2019 · 9 revisions

Snap! tab location: Sensing tab.

This command block configures a pin for PWM output.

Enter the pin number and PWM value in the range of 0-255.

SPECIAL NOTE: Configuring pins, other than this pin, for Tone or Servo operation can interfere with PWM operation. Tone will interfere with PWM output on pins 3 and 11 (on boards other than the Mega). On boards other than the Mega, servo configuration will interfere with PWM functionality on pins 9 and 10. On the Mega, it may interfere with PWM on pins 10 and 11.

Debugging Values

Debugger Value Explanation
0 No Error
4-1 The pin number specified is not an integer value
4-2 The pin number specified is not a valid pin number
4-3 Pin is not configured for PWM output
4-4 The PWM value must be an integer
4-5 The PWM value must be in the range of 0-255

Clone this wiki locally