InoDrive / IO / setOutput


InoDrive.IO.setOutput(target, state)

Control the Voltage State of a Specific Output.

Arguments:
Target (Integer or String) One of the Module’s Digital Outputs (0 to 2) or 'all'
State (Boolean) True or False, Set Output to High; False: Set Output to Low.

Returns:
Output Signal Changed (Boolean) { success: true }True or Null on successfully setting the Output.

// 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})

await Drive.IO.setOutput(target, state)

// To set Digital Output 1 to a High Voltage Output
await Drive.IO.setOutput(1,1)

// To set all Digital Outputs to a Low Voltage Output
await Drive.IO.setOutput("all", 0)