Timers_Class

setPWMOutputPin()

Description

This fuction creates a PWM out connected to the specified pin, with HIGH PPS mode. You should know that pins under the same timer share the same period.

Syntax

timer.setPWMOutputPin(pin)

Parameters

timer: a variable of type Timers_Class .

val: the selected pin number, type int.

Examples

This setup fuction serves to turn a LED on and off repeatedly. for difital I/O, the brightness is set to maximum during the "on" phase. (:source lang=c :)

  1. include <timer.h>

int led_pin = 11; Timers_class led; int setup () {

   led.SetPWMOutputPin(led_pin);
   led.SetPWMFrequency(8);
   return 0;

} (:sourceend:)

See also

Corrections, suggestions, and new documentation can be added directly to the wiki page. Scroll to the bottom, choose "Edit Page" and use "Papilio" as the password.

  

Share |