This is an implementation of the recent article on instructables.com describing a Twitter World Mood Light, ported to use the WiShield wireless networking device.
I thought that the idea of creating an embedded device that can perform complex analysis of realtime data, and then go on to produce a simplified result to be fascinating. So I had to build one. I just couldn’t bring myself to pay $90 for the WiFly, and found the WiShield at a more palatable $55. The biggest issue with processing web data in a microcontroller is that you just don’t have enough RAM to capture the whole page, so you have to process it in smaller chunks.
The original article is here:
http://www.instructables.com/id/Twitter-Mood-Light-The-Worlds-Mood-in-a-Box/
Even though the Twitter interface is working very well, I currently have my doubts about the LED – it’s not changing to the correct colors at the moment, need to check my wiring, and then take a look at the update routines.
bool GetHttpWebRequest(char* s)
{
// Create the webrequest
GETrequest getTweets(twitter_ip, 80, "www.twitter.com", s);
getTweets.setReturnFunc(printData);
getTweets.submit();
int count = 0;
// Process
while(getTweets.isActive())
{
WiServer.server_task();
delay(10);
count++;
// Timeout = 20 seconds approx
if (count > 2000)
return false;
}
return true;
}
UPDATE: I found out what was wrong with the LED – the library (as supplied) subtracted color values from 255 when setting the pins, I don’t think this is correct – it should set the color values directly – like this
// replace this
analogWrite(m_redPin, 255 - currentColor.r);
analogWrite(m_greenPin, 255 - currentColor.g);
analogWrite(m_bluePin, 255 - currentColor.b);
// with this
analogWrite(m_redPin, currentColor.r);
analogWrite(m_greenPin, currentColor.g);
analogWrite(m_bluePin, currentColor.b);
wherever analogWrite is called in LED.cpp.
UPDATE UPDATE: I had a quick chat with the original developer and his LED could well be an inverse configuration to mine – so this fix might not be necessary, depending on the type of LED you use.


Steve Hobley works for a software company, but in his spare time likes to deconstruct all the lovely consumer goods with a goal to make unique and interesting things.


















{ 1 comment… read it below or add one }
hey this is really awesome!
is there any way you could post the instructions on how to build one? or sell me that one!? lol