Connecting RIAs and hardware together

11,026 views
10,923 views

Published on

This session looks at the revolution in low cost, easy to program embedded computing and connecting it to the internet. Focusing on the Arduino open source hardware and software platform and how it can be easily connected to various RIA platforms – directly, via the ethernet or via the cloud. Topics covered range from digital and analogue input and output to creating your own Arduino web server (in under 20 lines of code). Show that it's easier than you realise to interface with hardware and that with a little knowledge you can do this.

Published in: Technology

Connecting RIAs and hardware together

  1. 1. Justin Mclean, Class Software Connecting Hardware to Rich Internet Applications Flex and the Arduino platform Tuesday, 1 June 2010
  2. 2. Who am I? Director of Class Software for 10 + years Developing and creating web applications for 15 years Programming for 25 years Adobe community professional in Flex Adobe certified developer and trainer in ColdFusion and Flex Based in Sydney Australia Tuesday, 1 June 2010
  3. 3. Electronics Trends Low cost components Small components Complex components with simple standard interfaces Tuesday, 1 June 2010
  4. 4. Computing Trends Easier to program Use of high level languages Software tools Open source Tuesday, 1 June 2010
  5. 5. Are We There Yet? Low cost fast devices It’s easy to communicate between devices and computers Can build complex systems from off the shelf components Tuesday, 1 June 2010
  6. 6. Arduino Overview of the Arduino Platform Tuesday, 1 June 2010
  7. 7. Arduino Platform Open source hardware and software platform Easy to program Hardware is flexible, fast, low power and low cost Tuesday, 1 June 2010
  8. 8. Arduino Hardware Comes in a number of shapes sizes Low cost Easy to extend Digital inputs/outputs Analog inputs Tuesday, 1 June 2010
  9. 9. Arduino Boards Tuesday, 1 June 2010
  10. 10. Arduino Boards Tuesday, 1 June 2010
  11. 11. Arduino Boards Tuesday, 1 June 2010
  12. 12. Arduino Boards Tuesday, 1 June 2010
  13. 13. Arduino Shields Tuesday, 1 June 2010
  14. 14. Arduino Shields Tuesday, 1 June 2010
  15. 15. Arduino Shields Tuesday, 1 June 2010
  16. 16. Arduino Shields Tuesday, 1 June 2010
  17. 17. Arduino Software Platform Open source cross platform IDE Alpha but very stable Updated frequently Growing and active community Tuesday, 1 June 2010
  18. 18. Arduino Code C like high level language Inbuilt functions to read and set digital and analog inputs and outputs Includes libraries to perform common hardware or software tasks Once uploaded programs are permanent Tuesday, 1 June 2010
  19. 19. Arduino IDE Tuesday, 1 June 2010
  20. 20. Led Shield Demo Tuesday, 1 June 2010
  21. 21. Led Shield Demo Tuesday, 1 June 2010
  22. 22. Issues Debugging can be hard No simulator Memory, power and speed limits Helps to have a little electronics knowledge Tuesday, 1 June 2010
  23. 23. Connecting Arduinos to the Web How Arduinos can communicate with the world Tuesday, 1 June 2010
  24. 24. Connection Methods Directto computer (USB) Wireless (XBee modems) Ethernet or WiFi “The Cloud” Tuesday, 1 June 2010
  25. 25. Supported Languages Flashand Flex Processing Python Ruby Java C, C++, C# and Objective C .NET Tuesday, 1 June 2010
  26. 26. Flex Flex to Arduino direct connection Tuesday, 1 June 2010
  27. 27. Layers of Communication Flexto proxy via an Actionscript library Proxy to USB communication USB to arduino Tuesday, 1 June 2010
  28. 28. Flex to Arduino Computer Arduino Flex Code Arduino Function Calls and Code Events TCP/IP USB AS3 Glue USB Proxy Firmata Socket Cable Tuesday, 1 June 2010
  29. 29. Flex Led Demo Tuesday, 1 June 2010
  30. 30. AS3Glue Digital Output Create arduino instance var arduino:Arduino = new Arduino(); Wait for firmware version Set digital pin as output arduino.setPinMode(pin, Arduino.OUTPUT); Turn digital output on arduino.writeDigitalPin(pin, Arduino.HIGH); Tuesday, 1 June 2010
  31. 31. Danger Shield Demo Tuesday, 1 June 2010
  32. 32. AS3Glue Analog Input Turn on analog reporting arduino.setAnalogPinReporting(pin, Arduino.ON); Listen for changes via event listener arduino.addEventListener (ArduinoEvent.ANALOG_DATA, onReceiveData); public function onReceiveData (event:ArduinoEvent):void { .... } Tuesday, 1 June 2010
  33. 33. Ethernet Using Arduino Ethernet Shields Tuesday, 1 June 2010
  34. 34. Ethernet Shields Allow direct internet connection No dedicated PC needed Shields need a little config Can act as web server or client Tuesday, 1 June 2010
  35. 35. Ethernet Shields Tuesday, 1 June 2010
  36. 36. Ethernet Shields Tuesday, 1 June 2010
  37. 37. Ethernet Shields Tuesday, 1 June 2010
  38. 38. Web Servers Simplerthan you think A web server: Listens for connections Parse requests Send back status messages/resources requested Tuesday, 1 June 2010
  39. 39. HTTP Requests Startwith request “GET index.html HTTP/1.1” Optional headers “Accept-Language: en” Empty line Optional message body (POST and other requests) Tuesday, 1 June 2010
  40. 40. Ethernet Arduino Code Web server code Easy to modify Tuesday, 1 June 2010
  41. 41. Ethernet Demo Tuesday, 1 June 2010
  42. 42. Rich Internet Applications Ideas on how and where to use this technology Tuesday, 1 June 2010
  43. 43. Environmental Monitoring Indoors or outdoors Wide range of sensors Sleep mode/low power consumption Tuesday, 1 June 2010
  44. 44. Home Automation Power and utilities monitoring Controlling Lights and Heating/Cooling Garden watering/monitoring Tuesday, 1 June 2010
  45. 45. Security and Safety Security systems Location reporting Bike jackets Tuesday, 1 June 2010
  46. 46. Why do this? Expose yourself to new ideas and new ways of solving problems Involves interaction with the real world Encourages creativity Makes you a better programmer Tuesday, 1 June 2010
  47. 47. It’s Fun! Tuesday, 1 June 2010
  48. 48. Questions? Ask now, see me after session or email justin@classsoftware.com Slides and code can be found at http://blog.classsoftware.com/ Tuesday, 1 June 2010
  49. 49. Useful Sites List of useful hardware and software sites Tuesday, 1 June 2010
  50. 50. Software Sites Arduino http://www.arduino.cc for software, user forum and playground Ethernet Shields http://arduino.cc/en/Reference/ Ethernet Pachhub http://www.pachube.com/ Tuesday, 1 June 2010
  51. 51. Hardware Sites Spark Fun (US) http://www.sparcfun.com/ Adafruit Industries (US) http://www.adafruit.com/ Electronic Goldmine (US) http://www.goldmine- elec.com/ Tuesday, 1 June 2010
  52. 52. Other Sites Lady Ada http://www.ladyada.com/ Evil Mad Scientist http://www.evilmadscientist.com/ NY Resistor http://www.nycresistor.com/ Make Zine http://www.makezine.com/ Tuesday, 1 June 2010

×