InoDrive / IO / getInputPolarity


InoDrive.IO.getInputPolarity(input)

Get the polarity of a specific input

Arguments:
Input (Number) Which input to get

Returns: Polarity (String) NPN or PNP

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

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

// Instantiate InoDrive Object
let Drive = await InoDriveApi.InoDrive({ target: "Name", autoConnect: true })

# Get All Input Polarities
let inputs = [0, 1, 2 ,3]

for (let item in inputs) {
    let polarity = await Drive.IO.getInputPolarity(item)
    if (polarity == "NPN") {
        console.log(`Input ${item} is set to NPN.`)
    } else {
        console.log(`Input ${item} is set to PNP.`)
    }
}