PWM

BlocklyProp PWM (pulse width modulation) blocks

For Propeller Activity Board WX, FLiP and Other board types. Not available for Badge or Scribbler Robot board types. Not available for Badge or Scribbler Robot board types.


PWM set

This block launches a processor automatically. Each subsequent instance of this block changes the PWM behavior as configured, but does not launch an additional processor.

The PWM set block begins outputting a pulse-width modulated signal on the pin specified in the drop-down box with a duty cycle set by the value block is. For example, if the value block is set to 75, the PWM signal will be on 75% of the time and off 25% of the time. There are two PWM channels available on the Propeller microcontroller, so up to two PWM set blocks (one set to channel A and the other set to channel B) operating at one time. Setting the duty cycle to 0 (zero) turns the PWM signal off.

The PIN menu this block can be set to “other.”  When “other” is chosen, the drop-down menu disappears, and it is replaced with an input.  You can then use any block that provides a numeric value such as a number value, get variable, or constant value block:

Note that the PWM Initialize block has been deprecated, and its functionality was added to the PWM set block


PWM stop

The PWM stop block stops the PWM process and frees up the resources it was using on the Propeller microcontroller.