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
let Drive = await InoDriveApi.InoDrive({ target: "Name", autoConnect: true })

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

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