Appendix B: Lua extensions
GPIO functions 73
BBBBB
Lua extensions
tcu_start_gpo_square_wave
Purpose: Start gpo square wave with specified interval.
Format: tcu_start_gpo_square_wave (pin, high_time, low_time,
duration)
pin: Pin number. Value: 1-7.
high_time: Time of high state in milliseconds.
low_time: Time of low state in milliseconds.
duration: Duration of square wave in milliseconds.
Value: 0=No timeout
2 - 2.147.483.647 milliseconds
After timeout, the pin will be left in high state.
Return value:
Error code: 0=OK, <0=error
Example: --Set pin 2 high for 50 ms every second. Stop after --1
minute.tcu_start_gpo_square_wave(2, 50, 950, 60000);
tcu_stop_gpo_square_wave
Purpose: Stop gpo square wave on specified pin.
Format: tcu_stop_gpo_square_wave (pin)
pin: Pin number: 1-7.
The pin will be left in high state.
Return value:
Error code: 0=OK, <0=error
Example: tcu_stop_gpo_square_wave(2);