int getPortDutyCycle(int ind)
Gets the duty cycle of the specified port/pin
Security
Trust Level Required: Full Trust
Parameters
Name | Description |
ind |
int The port/pin index. The pin must support Pulse Width Modulation (PWM). |
Return
The current duty cycle as a percentage (0 - 100) of the time the signal is on/high. If a non-PWM port/pin was specified, this will return -1.
Examples
var pin = 33;
KioGPIOBoard.setPortyDutyCycle(pin - 1, 50); // Sets pin 33 (minus 1 for 0 indexing) to 50% duty cycle
console.log(KioGPIOBoard.getPortDutyCycle(pin - 1));
Requirements
KioWare OS (Linux®) version 1.0 or greater.
Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.