PROGRAM 1
‘Simple BetaBrite Priority Message Sample
func main()
‘Open the ComPort
Const Ch1 1 ‘Zues Channel 1
ComOpen(Ch1,baud=9600,port=1,parity=2,bits=7,stop=2)
‘Tell the Sign we are ready to comunicate
ComOutput Ch1,chr(0)+chr(0)+chr(0)+chr(0)+chr(0)
ComOutput Ch1,chr(1)
ComOutput Ch1,”Z00”
‘Send Priority Text Message
ComOutput Ch1,chr(2)+”A0”
ComOutput Ch1,”Nuts and Volts”
ComOutput Ch1,chr(4)
CloseCom Ch1
endfunc
WEBLINKS
■ KronosRobotics website
www.kronosrobotics.com
■ KRMicros website
www.krmicros.com
■ Adaptive website
www.adaptivedisplays.com
■ BetaBrite website
www.BetaBrite.com
Zeus will automatically shut down
the comport for you
but it’s always smart
to do it yourself
with the CloseCom
command.
need to set the time once;
then you can comment the
code out. The clock will
keep the current time even
when new commands are
sent. Once power is
removed, the clock will stop.
When power is restored, the
clock will start again where it
left off and the last message
you sent will be displayed.
You will notice that now
all we need to do is use
the BBSendText along with various
pause commands and we can display
whatever we want to in real time.
Notice the second BBSendText
function call just after the Loop label
in Program 2. Change it to:
BBSendText(1,chr( 19))
“A” and a File label of “0.”
CloseCom Ch1
ComOutput Ch1,chr(2)+”A0”
This tells the sign that we are
sending a Priority Message.
You then send your message text
followed by an EOT (End of
Transmission, Value = 4)
ComOutput Ch1,”Nuts and Volts”
ComOutput Ch1,chr( 4)
Once the EOT character has been
sent, the message will display. By
default, the colors and display modes
will be in auto format so you will see
the message change. We will change
this setting later.
Now, wasn’t that simple? Program
1 shows the complete code example
we just discussed.
We are going to add a few new
features to the program, so in order to
simplify the code, let’s take all the
current code and place it in a function
called BBSendText. We will set the
function up so that we can pass the
com port and the text of the message
to be displayed. Then all we have to
do is call this function each time we
want to send new data.
We are also going to add a function called BBSetTime. This function
lets you send a four-character string to
set the current clock located inside
the sign. Yep, that’s right,
the sign has its own clock.
There is even a control
code that you can insert
into your text and the
current time will be substituted for that code.
BBSetTime will open
the com port, send a
Special Function command, and the four-digit
time string ( 24 hour
format). The function will
then send the EOT code
and close the com port.
Note that you only
What we are doing is sending a
control code that will tell the sign to
display the time. In this instance, the
control code is 19. Other commands
may require more than one sequence
of control characters.
Now for Program 3. We will add a
very powerful function to the previous
program. This function is called
ConvertCodes and will take our
text message, along with special
commands, and create some rather
cool effects. You can now control
the colors and scrolling effects of the
messages.
Here is a list of the commands
that you may insert into your message:
■ FIGURE 4
Colors
[RED] [GREEN] [AMBER] [DRED]
[DGREEN] [BROWN] [ORANGE]
[YELLOW] [RAINBOW1] [RAIN-
BOW2] [COLORMIX] [COLORAUTO]
Fonts
[SMALL] [SMALLWIDE] [LARGE]
[LARGEWIDE] [FANCY] [LARGE3D]
[LARGEWIDE3] [LARGEWIDE4]
[PROP] [FIXED]
Roll
[ROLL UP] [ROLL DOWN] [ROLL
LEFT] [ROLL RIGHT] [ROLL IN] [ROLL
OUT]
42
September 2006