Arduino and the mechanical relay using Renard

From diychristmas.org wiki
Jump to navigation Jump to search

Okay! Maybe you started with generic serial but noticed that most DIY controllers are using the Renard protocol. We have a sketch for that! Renard is a version of a serial protocol. What makes it Renard is that it has a built-in sync byte, start addresses, and escaped values for the values used for those things. Bill Porter (madsci1016) wrote a small library that handles the protocol so the base code becomes very easy.

You get the library here: Renard Protocol

Once you have it downloaded, just load it using Sketch/Include Library/Add .ZIP Library.

Having a library for the bringing in the serial data makes the program really simple. In the loop(), all we do is wait until we have filled the buffer and then we turn on/off lights.