Treehopper Java API
|
Built-in hardware PWM channels. More...
Public Member Functions | |
boolean | isEnabled () |
Gets whether this PWM pin is enabled. More... | |
void | setEnabled (boolean enabled) |
Sets whether this PWM pin is enabled. More... | |
double | getPulseWidth () |
Gets the pulse width of the pin. More... | |
void | setPulseWidth (double pulseWidth) |
Sets the pulse width of the pin. More... | |
double | getDutyCycle () |
Gets the duty cycle of the pin. More... | |
void | setDutyCycle (double dutyCycle) |
Sets the duty cycle of the pin. More... | |
Built-in hardware PWM channels.
Treehopper has three 16-bit hardware PWM channels labeled PWM1, PWM2, and PWM3. Like all peripherals, these are accessible from the TreehopperUsb instance.
double io.treehopper.HardwarePwm.getDutyCycle | ( | ) |
Gets the duty cycle of the pin.
Implements io.treehopper.interfaces.Pwm.
double io.treehopper.HardwarePwm.getPulseWidth | ( | ) |
Gets the pulse width of the pin.
Implements io.treehopper.interfaces.Pwm.
boolean io.treehopper.HardwarePwm.isEnabled | ( | ) |
Gets whether this PWM pin is enabled.
Implements io.treehopper.interfaces.Pwm.
void io.treehopper.HardwarePwm.setDutyCycle | ( | double | dutyCycle | ) |
Sets the duty cycle of the pin.
dutyCycle | the duty cycle, 0-1. |
Implements io.treehopper.interfaces.Pwm.
void io.treehopper.HardwarePwm.setEnabled | ( | boolean | enabled | ) |
Sets whether this PWM pin is enabled.
enabled | whether this PWM pin is enabled |
Implements io.treehopper.interfaces.Pwm.
void io.treehopper.HardwarePwm.setPulseWidth | ( | double | pulseWidth | ) |
Sets the pulse width of the pin.
pulseWidth | the pulse width, in microseconds |
Implements io.treehopper.interfaces.Pwm.