On This Page

Related Pages


Set the level of a PWM digital output

The AnalogOut widget sends values to hardware to continuously vary the output of a digital port. This is accomplished with PWM (Pulse Width Modulation), which rapidly switches the port on and off. This can vary the apparent brightness of an LED, or change the speed of a DC motor.

Be sure the port you select on your device supports PWM, because not all do. For example, on the Arduino, only the digital ports marked with a “~” are capable of PWM.


1 Connect

Connect another widget’s output to the input of AnalogOut.

To set the digital output port on your device, type in D plus the port number in the right hand tab. Be sure you select a port that is capable of PWM (Pulse Width Modulation). For example, on the Arduino, these are the digital ports with the “~” tilde character next to the number.

2 Simulate

Even without another widget connected, you can simulate input values by moving the on-screen “knob” to send values out to your hardware.

NETLabTK - Tangible IoT