Roku HD110 User Guide - Page 72

second each time the user presses a button on the BrightSign button/LED board.

Page 72 highlights

Here is an example of a script for the HD410, HD810, or HD1010 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) gpio.EnableInput(0) gpio.EnableInput(1) gpio.EnableInput(2) gpio.EnableInput(3) gpio.EnableOutput(4) gpio.EnableOutput(5) gpio.EnableOutput(6) gpio.EnableOutput(7) event_loop: msg=wait(0, p) if type(msg)"roGpioButton" then event_loop butn = msg.GetInt() if butn > 3 then event_loop gpio.SetOutputState(butn+4,1) print "Button Pressed: ";butn msg = wait (500, tmr) gpio.SetOutputState(butn+4,0) goto event_loop 66 • •

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118

66
Here is an example of a script for the HD410, HD810, or HD1010 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)
gpio.EnableInput(0)
gpio.EnableInput(1)
gpio.EnableInput(2)
gpio.EnableInput(3)
gpio.EnableOutput(4)
gpio.EnableOutput(5)
gpio.EnableOutput(6)
gpio.EnableOutput(7)
event_loop:
msg=wait(0, p)
if type(msg)<>"roGpioButton" then event_loop
butn = msg.GetInt()
if butn > 3 then event_loop
gpio.SetOutputState(butn+4,1)
print "Button Pressed: ";butn
msg = wait (500, tmr)
gpio.SetOutputState(butn+4,0)
goto event_loop