A practical guide to connecting hardware to Flex
Upcoming SlideShare
Loading in...5
×
 

A practical guide to connecting hardware to Flex

on

  • 6,333 views

WebDU 2009 session looking at the revolution in low cost easy to program embedded computing. It focuses on the arduino open source hardware and software platform and zigbee network modules and how ...

WebDU 2009 session looking at the revolution in low cost easy to program embedded computing. It focuses on the arduino open source hardware and software platform and zigbee network modules and how both of these can be easily connected up to Adobe Flex.

Statistics

Views

Total Views
6,333
Views on SlideShare
6,306
Embed Views
27

Actions

Likes
5
Downloads
135
Comments
4

4 Embeds 27

http://www.slideshare.net 19
http://www.pearltrees.com 5
http://www.linkedin.com 2
http://translate.googleusercontent.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-NonCommercial LicenseCC Attribution-NonCommercial License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Welcome name is etc. Hands who are developers, Flex developers. Give book away? I will show you how EASY it is to connect hardware to Flex and show you how you can do it. <br />
  • Keen interest in electronics but never studied it. Did start off in the bad old machine code days. Connecting hardware used to be difficult. Now this is fairly easy and straight forward to do. There’s been several trends that have made this easy. <br />
  • Computers are everywhere. Hands up who have one computer, 2 or 3, 4 or more? Microwave dishwasher, DVD, TVs etc etc are computers. They are not just general purpose ones. The processors in PC of a decade ago now run home appliances. These CPUs use to cost $1000 now cost $10. SMT technology. SPI an I2C Interfaces - more like lego where you can plug blocks of circuits together. Cheap low volume mean more niche and specialised products etc <br />
  • EEPROMS taken out of circuit erased under UV light for 15 min or so, then burnt in a special programmer 10 min or so. Put back in circuit. Test and repeat. Now it USB plug and play. Coding in machine code it’s hard to do and difficult to debug. Improve in processor speed and capacity and compilers mean you can code in high level languages. OS = Tools updated more often. <br />
  • Devices that can easily communicate with each other. Xbee/ZigBee modems are good example. In 5 years time we May think of mobile phones the same way we think of copper phone connections. Explain mesh networks. <br />
  • Ubiquitous computing - idea of countless small low powered low cost smart devices that are everywhere. They interact with their environment and we hardly notice they are there. Are we there? What is now possible? ...... Today I going to look on one open source product the Arduino. <br />
  • <br />
  • Italian. Software/IDE is open source. Explain hardware OS. Plans for building it are freely available and you can make up your own versions of the hardware. Fast = 20Mzh 386. 20 MIPS! Power 20-100mw. <br />
  • $20-$40 US. $30 US. ATmega of chip by Atmel AVR line. 32K flash memory 2K ram 1K EEPROM. 8 bit RISC chip run at 20Mzh == equiv to a fast 386. Less than 5 years CPU that cost $1000’s now the equiv cost $10’s - next 5 years the same is likely to happen. <br />
  • Some of the form factors. Diecimila (standard prototyping), Lillypad (wearable can be sown into clothing), Sanguino (more memory and IO), Mini (postage stamp). <br />
  • Some of the form factors. Diecimila (standard prototyping), Lillypad (wearable can be sown into clothing), Sanguino (more memory and IO), Mini (postage stamp). <br />
  • Some of the form factors. Diecimila (standard prototyping), Lillypad (wearable can be sown into clothing), Sanguino (more memory and IO), Mini (postage stamp). <br />
  • Ethernet shields, prototype shield, GPS shields, home made LED shield. <br />
  • Ethernet shields, prototype shield, GPS shields, home made LED shield. <br />
  • Ethernet shields, prototype shield, GPS shields, home made LED shield. <br />
  • Linux, Mac and PC. Current version 0015. Language is bases on wiring which is based on processing. New versions have tweaks, support for new boards and faster and more libraries. Generally no changes to core language. <br />
  • Simple IDE to write code, manage sketches (projects), compile and upload to the hardware via USB. <br />
  • Digital input and output can turn things on and off or detect if thinks are on or off. Anlog inputs can read light, temperate etc etc. No analog outputs but they can be simulated via PWM. Good for dimming leds. Libraries include ethernet, led matrix, LCD display. <br />
  • Show Arduino IDE and code, upload software to arduino. Show leds flashing on and off. <br />
  • All arduino programs has 2 main functions setup + loop <br />
  • For digital inputs set pin mode to INPUT and use digitalRead function. <br />
  • Flash player virtual machine no connection to USB etc. To make Flex talk to arduino and vice versa there needs to be layers of commuication. <br />
  • Need 3 layers. Serial communication built into arduino using serial library. <br />
  • Firmata based on midi. Simple binary protocol one or two bytes per command. AS3 glue Flex/AS3 library that does teh gard work for you. <br />
  • Load firmata software up to Arduino. Run code from Flex builder. <br />
  • <br />
  • <br />
  • <br />
  • 250 kbps data rate depending on distance. Voice OK video probably not, data no issue. Ordinary 1mW 35mA trans 100m $20. Pro 60mW 150mA trans 1.6km $30. 50mA receive. Sleep mode nothing. Can last months or years on a small battery! New pro hardware upto 60Km! Configure via AT commands. <br />
  • <br />
  • Mesh can automatically can form self healing dynamic networks. 100’s or 1000’s of nodes. <br />
  • Japanese arduino clone. Written more for Flash than Flex not event based so generally need to do some sort of polling. <br />
  • Demo. Show code. Give to audience member? <br />
  • <br />
  • <br />
  • Demo. Show code. <br />
  • <br />
  • While easy there are issues! <br />
  • Make you a better programmer. Limits of memory and speed. <br />
  • <br />
  • End slides here! URLs in book. CD software give away. Code on blog. <br />
  • <br />
  • <br />
  • <br />
  • <br />

A practical guide to connecting hardware to Flex A practical guide to connecting hardware to Flex Presentation Transcript

  • Connecting Hardware to Flex A practical guide to connecting open source hardware to Flex Justin Mclean Class Software Friday, 22 May 2009
  • Who am I? • Director of Class Software for 10 years • Developing and creating web applications for 15 years • Programming for 25 years • Adobe solution partner • Adobe certified developer and trainer in Flex and ColdFusion Friday, 22 May 2009
  • Electronics Trends • Low cost small components • More complex components with simple standard interfaces • Cheap low volume board manufacture Friday, 22 May 2009
  • Computing Trends • Easier to program • Use of high level languages • Software tools • Open source Friday, 22 May 2009
  • Communication Trends • Low cost long range wireless • Mesh networks Friday, 22 May 2009
  • 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 • Commercial and open source products and kits are available Friday, 22 May 2009
  • Arduino Open source hardware and software platform Friday, 22 May 2009
  • Arduino Platform • Open source hardware and software platform • Easy to program • Hardware is flexible, fast, low power and low cost Friday, 22 May 2009
  • Arduino Hardware • Comes in a number of shapes sizes • Low cost • Easy to program • Easy to extend Friday, 22 May 2009
  • Arduino Boards Friday, 22 May 2009
  • Arduino Boards Friday, 22 May 2009
  • Arduino Boards Friday, 22 May 2009
  • Arduino Boards Friday, 22 May 2009
  • Arduino Shields Friday, 22 May 2009
  • Arduino Shields Friday, 22 May 2009
  • Arduino Shields Friday, 22 May 2009
  • Arduino Shields Friday, 22 May 2009
  • Arduino Software Platform • Open source cross platform IDE • Alpha but very stable • Code in high level C like language • Updated frequently • Growing and active community Friday, 22 May 2009
  • Arduino IDE Friday, 22 May 2009
  • 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 Friday, 22 May 2009
  • Led Shield Demo Friday, 22 May 2009
  • Led Shield Demo Friday, 22 May 2009
  • Setup and Loop Functions • Setup function called once void setup() { ... } • Loop function called over and over again void loop() { ... } Friday, 22 May 2009
  • Setting Digital Outputs • Set digital pin as output in setup pinMode(pin, OUTPUT); • Digital outputs turned on or off in setup or loop digitalWrite(pin, HIGH); digitalWrite(pin, LOW); Friday, 22 May 2009
  • Flex Flex to Arduino communication Friday, 22 May 2009
  • Layers of Communication • Flex to proxy via an Actionscript library • Proxy to USB communication • USB to arduino Friday, 22 May 2009
  • Computer Arduino Flex Code Arduino Function Calls and Code Events TCP/IP USB AS3 Glue USB Proxy Firmata Socket Cable Flex to Arduino Friday, 22 May 2009
  • Flex Led Demo Friday, 22 May 2009
  • AS3Glue Digital Output • Create arduino instance var arduino:Arduino = new Arduino(); • Set digital pin as output arduino.setPinMode(pin, Arduino.OUTPUT); • Turn digital output on arduino.writeDigitalPin(pin, Arduino.HIGH); Friday, 22 May 2009
  • AS3Glue Events • Uses Flex events for digital inputs. • Listen for changes via event listener arduino.addEventListener (ArduinoEvent.DIGITAL_DATA, onReceiveData); public function onReceiveData(event:ArduinoEvent):void { } Friday, 22 May 2009
  • Wireless Communication Wireless communication with XBee modems Friday, 22 May 2009
  • XBee Modems • Hardware wireless modem • Low cost • Consume very little power • Good range • Easy to configure Friday, 22 May 2009
  • XBee Modem Friday, 22 May 2009
  • XBee Networks • Point to point • Point to multipoint • Mesh/Peer to peer Friday, 22 May 2009
  • Funnel IO • Arduino based hardware • Java server • Flex library Friday, 22 May 2009
  • Funnel Digital Output Friday, 22 May 2009
  • Funnel Digital Output Friday, 22 May 2009
  • Funnel Digital Output Friday, 22 May 2009
  • Setting Digital Output • Create FIO instance var fio:Fio = new Fio([1], Fio.FIRMATA); • Turn digital output on or off by setting value fio.ioModule(1).digitalPin(pin).value = 1; Friday, 22 May 2009
  • Funnel Analog Graph Friday, 22 May 2009
  • Funnel Analog Graph Friday, 22 May 2009
  • Reading Analog Input • Not event based, need to use timer • Read analog value same way as digital value value = ioModule(1).analogPin(pin).value; Friday, 22 May 2009
  • Issues • Debugging can be hard • No simulator • Memory, power and speed limits • Need a little electronic knowledge Friday, 22 May 2009
  • Why do this? • Expose yourself to new ideas and new ways of solving problems • Involves interaction with the real world • Encourages creativity • Platform limits improves programming skill Friday, 22 May 2009
  • It’s Fun! Friday, 22 May 2009
  • Questions? Ask now, see me after the session or email me at justin@classsoftware.com Friday, 22 May 2009
  • Useful Sites List of useful hardware of software sites Friday, 22 May 2009
  • Software Sites • Arduino http://www.arduino.cc for software, user forum and playground • AS3Glue http://code.google.com/p/as3glue/ • Funnel IO http://funnel.cc/ Friday, 22 May 2009
  • Hardware Sites • Little Bird Electronics (Australian) - http:// www.littlebirdelectronics.com/ • Jaycar (Australian) http://jaycar.com.au/ • Adafruit Industries (US) http:// www.adafruit.com/ • Spark Fun (US) http://www.sparkfun.com/ • Electronic Goldmine (US) http://www.goldmine- elec.com/ Friday, 22 May 2009
  • Other Sites • Lady Ada http://www.ladyada.net/ • Evil Mad Scientist http:// www.evilmadscientist.com/ • NY Resistor http://www.nycresistor.com/ • Make Zine http://makezine.com/ Friday, 22 May 2009