Appendix B: Lua extensions
72 GPIO functions
tcu_set_dac_value
Purpose: Set DAC output voltage.
Format: tcu_set_dac_value (value, channel)
value: Value: 0-3000 [mV].
channel: DAC channel. Value: 1
Return value:
Error code: 0=OK, <0=error
Example: --Set DAC value to 2V
tcu_set_dac_value(2000, 1);
tcu_set_gpo_pin
Purpose: Set state of output pin.
Format: tcu_set_gpo_pin (pin, state)
pin: Pin number: 1-7
state: Pin state: 0=low, 1=high
Pin changes from low to high at 350mV.
Return value:
Error code: 0=OK, <0=error
Example: --Set output pin 7 to high statetcu_set_gpo_pin(7,1);