void setPortIOStates(int64 ioMask)
Toggles the input/output state of all ports/pins, each represented by one bit
Security
Trust Level Required: Full Trust
Parameters
Name | Description |
ioMask |
int64 The new input/output states, where each bit is either 0 = output or 1 = input |
Return
Nothing returned
Examples
var pin = 3;
KioGPIOBoard.setPortIOStates(1 << (pin - 1)); // Set pin 3 as an input, and all other pins as outputs
if ((KioGPIOBoard.getPortStates() & 1 << (pin - 1)) > 0)
console.log('High voltage detected on pin ' + pin);
else
console.log('Low voltage detected on pin ' + pin);
Requirements
KioWare OS (Linux®) version 1.0 or greater.
Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.