Arduino World Mood Light using Twitter and WiShield

by Stephen Hobley on June 11, 2010

This is an implementation of the recent article on 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:

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, "", s);
      int count = 0;
      // Process
        // 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.


{ 2 comments… read them below or add one }

ashik October 27, 2011 at 10:55 am

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

Stefano Federici July 22, 2012 at 5:14 am

Hi Stephen,
I just bought a wishield and I’d like to read data from a website by a http GET. But, even if the shield works (as I can read data from “simple” websites, like, I couldn’t make even the simple webclient.pde example (included in the wishield library, this is supposed to change my status on twitter) work. Would you mind sending me your wishield version of the mood light project? Or, if you are so kind to have a look at it, I could maybe send you my wishield project? Thanks in advance for any help you can give me. (I’m really desperate, I’m supposed to convert an Arduino ethernet project of mine to wishield by next wednesday, something that I thought would have taken no more than couple of days, and I’m not even close to it. Help!)

Leave a Comment

Comments links could be nofollow free.

Previous post:

Next post: