void setPortState(int portInd, bool on)
Toggles the on/off or high/low state of a single port/pin
Security
Trust Level Required: Full Trust
Parameters
Name | Description |
portInd |
int The port/pin index |
on |
bool True to turn the port on / set the pin high, false to turn the port off / set the pin low |
Return
Nothing returned
Examples
var pin = 3;
KioGPIOBoard.setPortIOStates(0); // Set all pins as outputs
KioGPIOBoard.setPortState(pin - 1, true); // Sets pin 3 to the high state, subtracting 1 from the pin number for 0 indexing
console.log(KioGPIOBoard.getPortStates()); // Logs the current states
Requirements
KioWare OS (Linux®) version 1.0 or greater.
Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.