Difference between revisions of "Hw output add"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
== Description == | == Description == | ||
'''hw_output_id = hw_output_add(name, initial_state)''' (from AM 3.5) | |||
'''hw_output_id = hw_output_add(hw_id, initial_state)''' | '''hw_output_id = hw_output_add(hw_id, initial_state)''' | ||
Revision as of 11:52, 2 October 2018
Description
hw_output_id = hw_output_add(name, initial_state) (from AM 3.5) hw_output_id = hw_output_add(hw_id, initial_state)
hw_output_add is used to add a hardware output to your instrument.
Return value
Argument | Type | Description |
---|---|---|
hw_output_id | ID | This value can be used for further reference. Functions such as hw_output_set can use this hw_output_id. Its good practice to store this hw_output_id in your logic code. |
Arguments
# | Argument | Type | Description |
---|---|---|---|
1 | hw_id | String | The is the reference to the output. You can choose to bind to an existing Hardware ID (Hardware_id_list). |
2 | initial_state | Boolean | The initial state of the output. When true, the pin will be driven high, otherwise low. |
Example
-- Bind to Raspberry Pi 2, Header P1, Pin 38, and drive the output high
outp_id = hw_output_add("RPI_V2_P1_38", true)
-- Nah, rather have the output low
hw_output_set(outp_id, false)