
30
Here is an example script that will flash an LED for half a second each time a button is
pressed on the BrightSign button/led board.
print "BrightSign Button-LED Test Running"
p = CreateObject("roMessagePort")
tmr = CreateObject("roMessagePort")
gpio = CreateObject("roGpioControlPort")
gpio.SetPort(p)
sw = CreateObject("roGpioControlPort") 'switch/led control port
sw.SetPort(p)
event_loop:
msg=wait(0, p)
if type(msg)<>"roGpioButton" then event_loop
butn = msg.GetInt()
if butn > 5 then event_loop
sw.SetOutputState(butn+17,1)
print "Button Pressed: ";butn
msg = wait (500, tmr)
sw.SetOutputState(butn+17,0)
clear_events:
msg=p.GetMessage():if type(msg)<>"rotINT32" then clear_events
goto event_loop
Learning More and Support
The following resources can help you get the most from your BrightSign:
1. Visit www.rokulabs.com/brightsign
2. Refer to each of the different BrightSign documents available (listed at the start of
this manual).
3. Visit the BrightSign community Forums to discuss projects with other customers
and Roku engineers: www.rokulabs.com/forums
for help with custom projects
Comentarios a estos manuales