Treehopper C# API
HardwarePwmManager Class Reference

Hardware PWM manager More...

Public Member Functions

override string ToString ()
 Gets a string representing the state of the Hardware PWM manager More...
 

Properties

HardwarePwmFrequency Frequency [get, set]
 Gets or sets the PWM frequency of the pin, selected from HardwarePwmFrequency. More...
 
double MicrosecondsPerTick [get]
 Get the number of microseconds per tick More...
 
double PeriodMicroseconds [get]
 Get the number of microseconds per period More...
 
int FrequencyHz [get]
 Get an integer representing the current PWM frequency More...
 

Detailed Description

Hardware PWM manager

This class wouldn't typically be exposed to the user, but it provides one useful property: HardwarePwmFrequency.

With it, you can change the frequency that PWM1, PWM2, and PWM3 operate at. By default, the board uses a frequency of 732Hz, which helps avoid any trace of flicker when driving LEDs or other lighting. If you're driving motors or other inductive loads, you may wish to lower the frequency to reduce switching losses, or to lower the tone of the motor.

Member Function Documentation

◆ ToString()

override string ToString ( )

Gets a string representing the state of the Hardware PWM manager

Returns
the state of the hardware PWM manager

Property Documentation

◆ Frequency

HardwarePwmFrequency Frequency
getset

Gets or sets the PWM frequency of the pin, selected from HardwarePwmFrequency.

Defaults to 732 Hz.

◆ MicrosecondsPerTick

double MicrosecondsPerTick
get

Get the number of microseconds per tick

◆ PeriodMicroseconds

double PeriodMicroseconds
get

Get the number of microseconds per period

◆ FrequencyHz

int FrequencyHz
get

Get an integer representing the current PWM frequency


The documentation for this class was generated from the following file: