Skip to content

Instantly share code, notes, and snippets.

This gist covers the semantics of the SET_LIGHTS and SET_LIGHT_PATTERN packets specified in the communication protocol for Anki Overdrive vehicles. It is assumed that the reader already understands the basics of the protocol and can read C-style structs. Except when mentioned otherwise, only the payload is described. The packet header should be added as always.

SET_LIGHTS and SET_LIGHT_PATTERN fill the same nieche. In fact, SET_LIGHT_PATTERN can be used to achieve anything that SET_LIGHTS can and more. Imagine SET_LIGHTS as a selection of presets used in gameplay. We will go over SET_LIGHTS first as it is less complicated and was also the first packet I solved.

SET_LIGHTS

The SET_LIGHTS packet enables, disables or preserves the state of four different lighting presets. At its core, the payload struct looks like this:

struct set_lights_payload {
 uint8_t bitmask;