Blync

Following on the first part of the Blync hack, I want to be able to control the color from a terminal.

Let's create a simple protocol

Command Input in byte Output in byte
Default mode 0..7: 0 (AUTO) no output
Get current RGB value 0..7: 1 (GET) 0..7: Red as [0..255]
8..15: Green as [0..255]
16..23: Blue as [0..255]
Set RGB value 0..7: 2 (SET)
8..15: Red as [0..255]
16..23: Green as [0..255]
24..31: Blue as [0..255]
0..7: 1 (ACK)

Here is the Arduino code.

And here is the demo code in Python using pyserial.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.