Roku HD110 User Guide - Page 73
The following example script for the HD2000 flashes an LED for half a second each time the user
View all Roku HD110 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 73 highlights
The following example script for the HD2000 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 67 • •
67
•
•
•
•
•
•
The following example script for the HD2000 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