RC: LED Color Table command: EXP Bus Command Reference¶
Understanding EXP board addressing
This command is used with FAST Expansion and FAST breakout boards via a FAST Serial Protocol (FSP) connection to the EXP Bus. Please read the EXP Overview to understand the operation of these commands and addresses.
This command is used to set individual RGB LEDs to colors from a lookup table. You can chain together multiple LEDs in a single command.
Note that there is also an ASCII version of this command, RI:
, which might be more appropriate for your use case.
Command Syntax¶
RC:<count>[,<index><entry>...]
<count>¶
One byte, the binary count of how many LEDs will be updated via this command. This is needed since this command is binary, so the EXP processor needs to know the count of how much binary data to look for before it goes back to looking for ASCII characters. Valid ranges are 0-127 (binary 0x00
- 0x7F
) since that's the max LEDs that can be attached to a single breakout board.
<index>¶
This is the LED number for the LED you want to update. Individual LEDs are accessed via hex 00
- 7F
(0-127) since that's the max LEDs that can be attached to a single breakout board.
You can also use mapped LED blocks which you configured via the LM:
command. In this case, all the LEDs in that set will be updated to the same color as if they were a single LED.
If LED maps have previously been created on the expansion board targetted, then LED indexes 80
-FF
correspond to the mapped LED sets.
<entry>¶
Each color table entry is a single byte, in the range of 0-255 (hex 00
- FF
).
Default Color Table¶
The color table for each expansion board can be modified using the RT:
command. At power on the color table is initialized to a standard palette with a range of colors.
Examples¶
You can update more than one LED at a time with this command by putting commas between each LED.
For example, to update three LEDs:
- LED 01 - entry 0x10 (red)
- LED 04 - entry 0x60 (orange)
- LED 10 - entry 0x4E (purple)
The payload of this command would look like this before it was encoded to bytes:
0301100460104E
Breaking it down:
03
we are updating 3 LEDs in this command0110
set LED 01 to entry 100460
set LED 04 to entry 60104E
set LED 7A to entry 4E- No
<CR>
at the end!
But what would actually be sent over the wire is this:
RC:<raw bytes data that would look weird when printed>
Since this command is binary, there are no commas separating LEDs and no <CR>
at the end of it. (The "count" value tells the EXP Processor how many more bytes are coming, so the <CR>
is not needed.)
If you have a global fade rate set (via a previously-sent RF:
command for the board the LEDs are attached to), then the LEDs will fade to the target color over the set time.
Note this command has a 50ms timeout which cancels it if has not received all of the data within that time.
Return Response¶
None
N or > jump the next page, P or < for previous, search with S or ?