PWM Pin Element

The PWM pin element is used to drive the pulse-width modifier (PWM) level of a valid PWM pin.

The PWM pin element is located in the Element Toolbox within Studio’s Embedded tab.

Properties

The following properties can be changed for the PWM pin element:

Name

The name of the element.

PWM Instance

The PWM driver instance number to use. If unsure, leave it set to the default value.

PWM Pin

The hardware’s PWM pin the element is connected to.

Frequency (Hz)

The frequency (in Hz) the PWM is set to.

Duty Cycle

The percentage the pin’s duty cycle operates at from 0-100%.

Triggers

The following triggers are available to execute events from within the PWM pin element:

Triggered

Execute an event when the source element connected to the PWM pin triggers.

Duty Cycle Set

Execute an event when the PWM’s duty cycle percentage is set.

Abilities

The following abilities are available for the PWM pin element when its source element triggers:

Trigger

Trigger the element(s) that follow the PWM pin element.

Set Duty Cycle

Set the pin’s duty cycle percentage.

Element Resources

Atmosphere includes a selection of resources for users of all levels that demonstrate using the PWM pin element.

Demo Projects

To view the PWM pin element used within a project, click the demo’s name to open the project in Atmosphere and see how the element is set up.

Name Hardware Description
PWM Pin Arduino Demo Arduino Mega The PWM pin element is used within this demo project by increasing the brightness of the Arduino Mega’s LED alongside counter and mathematical operation elements.
PWM Pin ESP32 Demo HUZZAH32 The PWM pin element is used within this demo project by increasing the brightness of the ESP32’s LED alongside counter and mathematical operation elements.
PWM Pin nRF Demo nRF52840-DK The PWM pin element is used within this demo project by increasing the brightness of two LEDs on the nRF52840-DK.