void setPortState(int, boolean )
Sets the output state on the specified pin.
Parameters
Name | Description |
portInd |
int The index of the pin being set. |
on |
boolean If true, output state set to on. If false output state set to off. |
Remarks
If portInd is an input pin, it will be converted to an output pin.
Examples
var GPIOdeviceInfo;
function setPortOutput(port, output) {
KioGPIOBoard.setPortState(port, output);
}
function onNumatoGPIOOpened(success) {
if(success) {
GPIOdeviceInfo = JSON.parse(KioGPIOBoard.getDeviceInfo());
KioWareUtils.LogInfo('Firmware Version: ' + GPIOdeviceInfo.version + 'Device Id: ' + GPIOdeviceInfo.id);
//Set last port output
setPortOutput(31, true);
}
else KioWareUtils.LogErr('GPIO device failed to open');
}
Requirements
KioWare for Android version 3.22 or greater.