Roku Network Router HD2000 User Manual

Page of 54
 
35
Registry (HD2000 only) 
The BrightSign has an I2CROM with 2K bytes of memory that supports the storage of 
persistent settings. The purpose of the registry is to enable customers to persist usage 
statistics and other small amounts of information that may change regularly. 
 
Individual items are stored in the registry through the use of registry keys and values. For 
example, there might be a registry key named “NumberOfButtonPresses”; the 
corresponding registry value would be used to count the number of times a button is 
pressed. Registry data can be organized into different registry sections if desired. 
 
CSV files support writing to the registry, deleting from the registry, and displaying the 
contents of the registry – see the Using Excel to Create Interactive Signs section earlier in 
the document. The contents of the registry can also be displayed from a playlist – see the 
Playlist Commands section earlier in the document. 
 
The number of registry keys and values that can be used is dependent on a number of 
factors, including the number of sections, the number of keys/values per section, and the 
size of the keys and values. In typical usage, there’s room in the registry for about 50 
keys. 
GPIO Control Port 
The BrightSign has a DB25 General Purpose Input Output (GPIO) Port.   This port has 
12 inputs that can be directly connected to buttons or switches, and 6 outputs that can 
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.   Roku has a test button/LED board 
that you can purchase to evaluate the GPIO port and test your scripts that read the buttons 
or set the LEDs.    
 
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) 
 
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: