User guide

38
11
BrightScript> ?type(5)
rotINT32
BrightScript> if 1=1 then print"1 does equal 1!" else print "strange!"
1 does equal 1!
BrightScript> ?right("abcdef",3)
def
BrightScript> exit
Roku>
Registry (HD2000 only)
The BrightSign HD2000 has an I2C EEPROM with 2K bytes of memory that supports
the storage of persistent settings. The BrightSign software registry object is how
BrightScript reads and writes data to this eeprom. 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. In addition, the registry can be
accessed by a custom script using the roRegistry object (see the BrightSign Object
Reference Manual for additional information).
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"