Change my LED via the web!

Here is an example of how to make a cool Internet application using the XPort shield I recently released. This is very simple, but its a good example of getting and outputting data. Basically the Arduino serves up a webpage with a bunch of nice javascript code that allows you to select a color. It also displays a “current color” (in this case a light green)

When you click "Submit" on the page, another request is made to the XPort/Arduino, this time with a GET command ?color=#xxxxxx with the color information. The Arduino looks for this command, parses the color requested and calls analogWrite() on the three LEDs to change them into that color.

Want to try it out? Go to -> http://ladyada.net/make/eshield/colorpickerfwd.html which will forward you to the correct IP address (since I dont have DNS for my home network). The XPort can only receive one connection at a time so if you cant get thru, please be patient! :)

Read more about the XPort shield here and get the source code and other details from this page

Filed under: arduino,kits — by ladyada, posted April 2, 2008 at 8:50 pm


Try Adafruit's new iPhone & iPad app for makers! Circuit Playground! "Incredibly handy for anyone working in electronics. Perfect for engineers and non-engineers alike."
Looking for engineers, makers and the builders of dreams? Try our Adafruit job boards.
Join our weekly Adafruit SHOW-AND-TELL at 9:30pm ET every Saturday night! Then at 10pm, ASK-AN-ENGINEER with Ladyada and the Adafruit team!

3 Comments

  1. Wow that looks great. I think you pretty much convinced me to buy a XPort Direct =)

    Comment by Dagnir — April 3, 2008 @ 12:41 am

  2. Wha :) I’ve just bought this xport shield last week, and was hoping to do something similar, now it’s great to have some code to extend the idea a bit further :)

    Comment by Alex — April 4, 2008 @ 6:53 am

  3. It´s soo interesting. Have a nice day.

    Comment by Angel — April 14, 2008 @ 9:36 am

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

www.flickr.com
adafruit's items Go to adafruit's photostream
www.flickr.com
items in Adafruits More in Adafruits pool