InoDrive / IO / getInput


InoDrive.IO.getInput(input)

Get Voltage State of Specific Configurable Input.

Arguments:
Digital Input (Number) Module’s Input Range (0 to 3).

Returns:
Input Voltage Signal (Boolean) Low(0) or High(1)
• 0 – Low
• 1 – High

// Import InoDrive API Library
 import { InoDriveApiJS }  from ( "ck-inodrive-api" ) 

// Instatiate the API
let InoDriveApi = new InoDriveApiJS.InoDriveApi({ connectAppUrl: "", secure: false })

// Instantiate InoDrive Object
Drive = await InoDriveApi.InoDrive({target:'Name', autoConnect:True})

// Get All Input States
let inputs = [0, 1, 2, 3] 
for(i in inputs){
    let state = await Drive.IO.getInput(i)
    if(state == 0){
        console.log(`Input ${ i } is low`)
    }else{
        console.log(`Input ${ i } is high`)
    }
}