ColorPAL documentation

© Parallax, Inc. • ColorPAL (2009.06.15) Page 8 of 12
DO
SEROUT sio, baud, ["+01= G !+02= B !"] : PAUSE 1000
SEROUT sio, baud, ["+01= B !+02= G !"] : PAUSE 1000
SEROUT sio, baud, ["+00= R !"] : PAUSE 1000
LOOP
Program Commands
While the ColorPAL is in Buffering mode, you can enter the commands that actually do something, like
light up the LEDs or take a color sample. Here are the commands that it can accept.
— LED Commands —
WARNING! The light from the RGB LED is very concentrated and can be
very
bright. Just as you would
not stare at the sun (and for the same reason), do not stare directly at the LED.
rnnnnnn
Display RGB Color on LED
A lowercase r followed by six hex digits will cause the LED to display the selected color components, with
00 being fully “off”, FF being fully “on”, and numbers in between representing various intermediate
intensities. To display the color orange, for example, you can send the following command:
SEROUT sio, baud, ["= rC04000 !"]
This causes the red LED segment to light up at 75% intensity (C0) and the green segment to light at
25% intensity (40). The blue segment remains “off” (00).
A - Z
Display Named Color on LED
The
uppercase
letters represent predefined color names. These are, in order by hue (with letter
designators in boldface, along with their hexadecimal equivalents):
Color Hex Color Hex
Red FF0000 roSe E00020
Tangerine E02000
Pink C00040
Orange C04000
orchiD A00060
Flame A06000
Magenta 800080
Yellow 808000
Amethyst 6000A0
cHartreuse 60A000
Violet 4000C0
Lime 40C000
Indigo 2000E0
Emerald 20E000
Blue 0000FF
Green 00FF00 sKy 0020E0
Jade 00E020
aZure 0040C0
maNganese 00C040
tUrquoise 0060A0
aQua 00A060
Cyan 008080
X LED Off 000000
White 555555
For example, to display the color “jade”, you’d send the following:
SEROUT sio, baud, ["= J !"]