Step 3Firmware
Firmware
The latest firmware downloads are on the project Google Code page. The code is written in C, and compiled with the free Microchip C30 demonstration compiler.
The firmware uses an adapted version of the #twatch source code to connect to Twitter over the internet. It opens a TCP connection and sends a search query for '@tweet_tree', the response is a JSON formatted data file like this.
A JSON parsing state machine searches through the data for the 'text' and the 'id' tags. The text tag value is processed for color commands. The value of the first id tag is stored too. We'll use it to limit results to new tweets in the next search query. Hint: try JSONView to work with JSON in Firefox.
If a new color command is found, the LED fades into the new color. If multiple commands or tweets are found, the colors morph from oldest to newest, with a 5 second pause between each. The tree always ends on the most recently tweeted color.
Every minute, or after completing a stored sequence, whichever takes longest, the web platform queries Twitter for fresh tweets. It appends the saved id tag value to the search query so the feed only returns new tweets. Twitter limits the number of queries you can make in an hour, but 60 is well below the limit.
The ShiftBrite is controlled with bitbang routines from our RGB remote control pumpkin project.
Compiling
This firmware uses the free Microchip TCPIP stack. If you want to compile the firmware yourself, download the TCPIP stack and follow the instructions in main.c.
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|












































