We use the IRLib library to decode the signal from the infrared detector. This library supports many of the common TV remote controls. Use the included example sketch IRecvDump to see if your remote is supported. On the serial monitor you should see something like “Decoded NEC(1): Value:FD808F (32 bits)”. If you have a supported remote control, skip to the “Movements” section further down this page.
In our case, we had to add support for our SilverLit remote control.
The SilverLit Remote Control vehicle protocol is meant to the SilverLit RC set that was sold through Costco and included a dump truck, flatbed, bulldozer or crane. We reuse this remote control to direct the movements of the Droid robot.
The protocol was undocumented, and I reverse engineered it. Turns out that the remote control first transmits a header burst of 38 kHz infrared light. The bits are then transferred as short or longer period with no IR light (space) followed by short burst of IR light (mark).
|header||1.778 msec mark|
|13 bits||data bits|
|1 bit||stop bit|
The bits are encoded as shown below.
|“0”||0,400 msec space, followed by 0.722 msec mark|
|“1”||1.037 msec space, followed by 0.722 msec mark|
The data bits are shown in the table below.
|[12:11]||vehicle identifier (00=dumptruck, 01=flatbed, 10=bulldozer, 11=crane)|
|[10:9]||no special meaning. 11 when bit is 0, otherwise 00|
|||0 for backward|
|||0 for forward|
|||1 for right|
|||1 for left|
|||1 for down|
|||1 for up|
|||1 for light on|
|[1:0]||checksum (see below)|
The CRC is calculated as follows
checksum = bit[11:12] ^ bit ^ bit[9:8] ^ bit[7:6] ^bit[5:4] ^ bit[3:2]
2BD: describe how instructions trigger movements