0
A PRACTICAL GUIDE TO                        CONNECTING HARDWARE TO                        FLEX                        Just...
Who am I?                    • Director of Class Software for almost 15 years                    • Developing and creating...
Electronics Trends                    • Low cost components                    • Small components                    • Com...
Computing Trends                    •   Easier to program                    •   Use of high level languages              ...
Are We There Yet?                    • Low cost fast devices                    • It’s easy to communicate between devices...
Arduino                        Overview of the Arduino PlatformTuesday, 21 June 2011
Arduino Platform                    • Open source hardware and software platform                    • Easy to program     ...
Arduino Hardware                    •   Comes in a number of shapes and sizes                    •   Low cost             ...
Arduino BoardsTuesday, 21 June 2011
Arduino BoardsTuesday, 21 June 2011
Arduino BoardsTuesday, 21 June 2011
Arduino BoardsTuesday, 21 June 2011
Arduino ShieldsTuesday, 21 June 2011
Arduino ShieldsTuesday, 21 June 2011
Arduino ShieldsTuesday, 21 June 2011
Arduino ShieldsTuesday, 21 June 2011
Arduino Software Platform                    •   Open source cross platform IDE                    •   Alpha but very stab...
Arduino Code                    • C/C++ but not scary!                    • Inbuilt functions to read and set digital and ...
Arduino IDETuesday, 21 June 2011
Led Shield DemoTuesday, 21 June 2011
Led Shield DemoTuesday, 21 June 2011
Issues                    •   Debugging can be hard                    •   No simulator                    •   Memory, pow...
Connecting                        to the Web                        How Arduinos can communicate with                     ...
Connection Methods                    •   Direct to computer (USB)                    •   Wireless (XBee modems)          ...
Supported Languages                    •   Flash and Flex                    •   Processing                    •   Python ...
Flex                        Flex to Arduino direct connectionTuesday, 21 June 2011
Layers of Communication                    • Flex to proxy via an Actionscript library                    • Proxy to USB c...
Computer                       Arduino                            Flex Code                                       Arduino ...
Flex Led DemoTuesday, 21 June 2011
AS3Glue Digital Output                    • Create arduino instance                        var arduino:Arduino = new Ardui...
Danger Shield DemoTuesday, 21 June 2011
AS3Glue Analog Input                    • Turn on analog reporting                        arduino.setAnalogPinReporting(pi...
Ethernet                        Using Arduino Ethernet ShieldsTuesday, 21 June 2011
Ethernet Shields                    •   Allow direct internet connection                    •   No dedicated PC needed    ...
Ethernet ShieldsTuesday, 21 June 2011
Ethernet ShieldsTuesday, 21 June 2011
Ethernet ShieldsTuesday, 21 June 2011
Web Servers                    • Simpler than you think                    • A web server:                      • Listens ...
HTTP Requests                    •   Start with request “GET index.html HTTP/1.1”                    •   Optional headers ...
Ethernet Arduino Code                    • Web server code                    • Easy to modifyTuesday, 21 June 2011
Ethernet DemoTuesday, 21 June 2011
Applications                         Ideas on how and where to use this                         technologyTuesday, 21 June...
Environmental Monitoring                    • Indoors or outdoors                    • Wide range of sensors              ...
Home Automation                    • Power and utilities monitoring                    • Controlling Lights and Heating/Co...
Security and Safety                    • Security systems                    • Location reporting                    • Bik...
Why do this?                    • Expose yourself to new ideas and new ways of                        solving problems    ...
It’s Fun!Tuesday, 21 June 2011
Questions?                        Ask now, see me after the session,                        follow me on twitter @justinmc...
Resources                        Finding out more informationTuesday, 21 June 2011
Arduino Sites                    •   Ardunio (http://ardunio.cc)                    •   Spark fun (http://www.sparkfun.com...
Electronic Components Suppliers                    • Electric Goldmine (http://www.goldmine-elec-                        p...
Other Sites                    • Make magazine (http://makezine.com/)                    • Evil Mad Scientist (http://    ...
Upcoming SlideShare
Loading in...5
×

A Practical Guide to Connecting Hardware to Flex

1,981

Published on

A look at the revolution in low cost, easy to program embedded computing and how to connect it to Flex. Focusing on the Arduino open source hardware and software platform and how it can be easily connected both directly and via the Ethernet. The slides cover digital and analogue input and output and how to create your own web server (in under 20 lines of code). It’s easier than you realise to interface Flex with hardware and with a little knowledge you too can can do this.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,981
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
53
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Transcript of "A Practical Guide to Connecting Hardware to Flex"

  1. 1. A PRACTICAL GUIDE TO CONNECTING HARDWARE TO FLEX Justin Mclean Class Software Email: justin@classsoftware.com Twitter: @justinmclean Blog: http://blog.classsoftware.comTuesday, 21 June 2011
  2. 2. Who am I? • Director of Class Software for almost 15 years • Developing and creating web applications for 15 years • Programming for 25 years • Adobe certified developer and trainer in Flex and ColdFusion • Adobe Community Champion • Based in Sydney AustraliaTuesday, 21 June 2011
  3. 3. Electronics Trends • Low cost components • Small components • Complex components with simple standard interfacesTuesday, 21 June 2011
  4. 4. Computing Trends • Easier to program • Use of high level languages • Software tools • Open sourceTuesday, 21 June 2011
  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 componentsTuesday, 21 June 2011
  6. 6. Arduino Overview of the Arduino PlatformTuesday, 21 June 2011
  7. 7. Arduino Platform • Open source hardware and software platform • Easy to program • Hardware is flexible, fast, consumes very little power and is cheapTuesday, 21 June 2011
  8. 8. Arduino Hardware • Comes in a number of shapes and sizes • Low cost • Easy to extend • Digital inputs/outputs • Analog inputsTuesday, 21 June 2011
  9. 9. Arduino BoardsTuesday, 21 June 2011
  10. 10. Arduino BoardsTuesday, 21 June 2011
  11. 11. Arduino BoardsTuesday, 21 June 2011
  12. 12. Arduino BoardsTuesday, 21 June 2011
  13. 13. Arduino ShieldsTuesday, 21 June 2011
  14. 14. Arduino ShieldsTuesday, 21 June 2011
  15. 15. Arduino ShieldsTuesday, 21 June 2011
  16. 16. Arduino ShieldsTuesday, 21 June 2011
  17. 17. Arduino Software Platform • Open source cross platform IDE • Alpha but very stable • Version 1.0 out in the next month • Updated frequently • Growing and active communityTuesday, 21 June 2011
  18. 18. Arduino Code • C/C++ but not scary! • 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 permanentTuesday, 21 June 2011
  19. 19. Arduino IDETuesday, 21 June 2011
  20. 20. Led Shield DemoTuesday, 21 June 2011
  21. 21. Led Shield DemoTuesday, 21 June 2011
  22. 22. Issues • Debugging can be hard • No simulator • Memory, power and speed limits • Helps to have a little electronics knowledgeTuesday, 21 June 2011
  23. 23. Connecting to the Web How Arduinos can communicate with the worldTuesday, 21 June 2011
  24. 24. Connection Methods • Direct to computer (USB) • Wireless (XBee modems) • Ethernet or WiFi • “The Cloud”Tuesday, 21 June 2011
  25. 25. Supported Languages • Flash and Flex • Processing • Python • Ruby • Java • C, C++, C# and Objective C • .NETTuesday, 21 June 2011
  26. 26. Flex Flex to Arduino direct connectionTuesday, 21 June 2011
  27. 27. Layers of Communication • Flex to proxy via an Actionscript library • Proxy to USB communication • USB to arduinoTuesday, 21 June 2011
  28. 28. Computer Arduino Flex Code Arduino Function Calls and Code Events TCP/IP USB AS3 Glue USB Proxy Firmata Socket Cable Flex to ArduinoTuesday, 21 June 2011
  29. 29. Flex Led DemoTuesday, 21 June 2011
  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, 21 June 2011
  31. 31. Danger Shield DemoTuesday, 21 June 2011
  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, 21 June 2011
  33. 33. Ethernet Using Arduino Ethernet ShieldsTuesday, 21 June 2011
  34. 34. Ethernet Shields • Allow direct internet connection • No dedicated PC needed • Shields need a little config • Can act as web server or clientTuesday, 21 June 2011
  35. 35. Ethernet ShieldsTuesday, 21 June 2011
  36. 36. Ethernet ShieldsTuesday, 21 June 2011
  37. 37. Ethernet ShieldsTuesday, 21 June 2011
  38. 38. Web Servers • Simpler than you think • A web server: • Listens for connections • Parse requests • Send back status messages/resources requestedTuesday, 21 June 2011
  39. 39. HTTP Requests • Start with request “GET index.html HTTP/1.1” • Optional headers “Accept-Language: en” • Empty line • Optional message body (POST and other requests)Tuesday, 21 June 2011
  40. 40. Ethernet Arduino Code • Web server code • Easy to modifyTuesday, 21 June 2011
  41. 41. Ethernet DemoTuesday, 21 June 2011
  42. 42. Applications Ideas on how and where to use this technologyTuesday, 21 June 2011
  43. 43. Environmental Monitoring • Indoors or outdoors • Wide range of sensors • Sleep mode/low power consumptionTuesday, 21 June 2011
  44. 44. Home Automation • Power and utilities monitoring • Controlling Lights and Heating/Cooling • Garden watering/monitoringTuesday, 21 June 2011
  45. 45. Security and Safety • Security systems • Location reporting • Bike jacketsTuesday, 21 June 2011
  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 programmerTuesday, 21 June 2011
  47. 47. It’s Fun!Tuesday, 21 June 2011
  48. 48. Questions? Ask now, see me after the session, follow me on twitter @justinmclean or email me at justin@classsoftware.com. Code and slides can be found at http://blog.classsoftware.comTuesday, 21 June 2011
  49. 49. Resources Finding out more informationTuesday, 21 June 2011
  50. 50. Arduino Sites • Ardunio (http://ardunio.cc) • Spark fun (http://www.sparkfun.com) • Lady Ada (http://ladyada.net) • Seeed Studio (http://www.seeedstudio.com) • Modern Device (http://moderndevice.com)Tuesday, 21 June 2011
  51. 51. Electronic Components Suppliers • Electric Goldmine (http://www.goldmine-elec- products.com/) • Digikey (http://www.digikey.com/) • Farnell (http://ww.farnell.com/)Tuesday, 21 June 2011
  52. 52. Other Sites • Make magazine (http://makezine.com/) • Evil Mad Scientist (http:// evilmadscientist.com) • NYC Resistor (http://nycresistor.com)Tuesday, 21 June 2011
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×