It's been a while since we've had any updates, but a lot of things have been going on. First was our switchover to using the uIP stack. This stack is much more robust and battle-hardened, and has been a big step forward for our user base. Another good thing has been Mark Patel's work on the WiServer add-on, which makes serving webpages using the WiShield super easy. In this article, we'll demonstrate using the WiServer code, and also touch on some points for optimizing for small handheld devices like the iPhone. We'll have more on Mark and his QPID project (which the WiServer was originally written for) in a forthcoming article. The seven segment display comes from SparkFun. Contrary to what the datasheet says, the middle pin on each side is the common anode, and is hooked to the 3.3V rail of the Arduino. The seven segments were then wired to digital I/O of the Arduino. A digital HIGH signal will turn the segment off, and a digital LOW signal will turn the segment on. We wrote a simple case statement decoder that gives the correct output for each segment. The WiServer code couldn't be any more simpler to use. Mark has provided a sample sketch with WiServer. We've modified that sketch to parse a GET request with the button's name as a variable. Whenever the WiServer code sees this, it calls the function to increment the seven segment display, and also sends back the same webpage to the requesting client. You can see this in action in the following video (apologies for the poor video quality and the blinding bright blue LEDs!) You'll notice on the iPod the Clicky! button is quite large. This can be done by adding the following line to your <head> section: <meta name="viewport" content="width=device-width"> Below are two pictures that show the difference with and without this piece of code. Non-optimized (you would have to do a two-finger zoom in to click the button correctly):
Optimized (much easier to click): 
This example sketch can be downloaded from here, and will be available in future releases of the WiShield stack code.
|