Treehopper C# API
Pin Class Reference

PCA9685 pin More...

Inheritance diagram for Pin:
Pwm

Public Member Functions

Task EnablePwmAsync ()
 Enable the PWM functionality More...
 
Task DisablePwmAsync ()
 Disables the PWM functionality More...
 

Properties

double DutyCycle [get, set]
 Gets or sets the duty cycle of this pin More...
 
bool Enabled [get, set]
 Whether the PWM pin is enabled. More...
 
double PulseWidth [get, set]
 Gets or sets the pulse width, in microseconds. More...
 

Detailed Description

PCA9685 pin

Member Function Documentation

◆ EnablePwmAsync()

Task EnablePwmAsync ( )

Enable the PWM functionality

///

Returns
An awaitable task that completes when the PWM functionality is enabled

Implements Pwm.

◆ DisablePwmAsync()

Task DisablePwmAsync ( )

Disables the PWM functionality

Returns
An awaitable task that completes when the PWM functionality is disabled

Implements Pwm.

Property Documentation

◆ DutyCycle

double DutyCycle
getset

Gets or sets the duty cycle of this pin

◆ Enabled

bool Enabled
getset

Whether the PWM pin is enabled.

Writes to this value are ignored, and will always read as "true"

◆ PulseWidth

double PulseWidth
getset

Gets or sets the pulse width, in microseconds.

This property will read the Pca9685.Frequency of the driver and change the DutyCycle property of this pin to set the desired pulse width. The accuracy of this property is dependent on the oscillator source; the PCA9685 internal oscillator is not nearly as accurate as an external crystal oscillator, so if you need accurate pulse width control, consider using an external oscillator.


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