Using the gpio control port – BrightSign HD2000 User Guide User Manual
Page 70

64
•
•
•
•
•
•
Using the GPIO control port
BrightSign has a DB25 General Purpose Input Output (GPIO) Port. This port has 12 inputs that you
can directly connect to buttons or switches, and 6 outputs that you can use to directly drive LEDs.
To use this port you must create a simple but custom cable that connects a DB25 connector to
your buttons or LEDs. See the BrightSign Hardware Manual for more information and example
circuits. You can also purchase a test button/LED board from BrightSign to evaluate the GPIO
port and test scripts that read these buttons or set these LEDs.
Here is an example of a script that flashes an LED for half a second each time the user presses a
button on the BrightSign button/led board.
print "BrightSign Button-LED Test Running"
p = CreateObject("roMessagePort")
tmr = CreateObject("roMessagePort")
gpio = CreateObject("roGpioControlPort")
gpio.SetPort(p)
event_loop:
msg=wait(0, p)
if type(msg)<>"roGpioButton" then event_loop
butn = msg.GetInt()
if butn > 5 then event_loop
gpio.SetOutputState(butn+17,1)
print "Button Pressed: ";butn
msg = wait (500, tmr)
gpio.SetOutputState(butn+17,0)
clear_events:
msg=p.GetMessage():if type(msg)<>"rotINT32" then clear_events
goto event_loop