SlideShare uma empresa Scribd logo
1 de 50
Baixar para ler offline
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

Mais conteúdo relacionado

Semelhante a A practical guide to connecting hardware to Flex

Connecting Hardware to Flex (360MAX)
Connecting Hardware to Flex (360MAX)Connecting Hardware to Flex (360MAX)
Connecting Hardware to Flex (360MAX)Justin Mclean
 
Ubiquitous Content Symposium 2009
Ubiquitous Content Symposium 2009Ubiquitous Content Symposium 2009
Ubiquitous Content Symposium 2009Shigeru Kobayashi
 
IT Depends: Custom vs Packaged Software
IT Depends: Custom vs Packaged SoftwareIT Depends: Custom vs Packaged Software
IT Depends: Custom vs Packaged Software★ Selcuk Atli
 
iPhone Development For .Net Dev
iPhone Development For .Net DeviPhone Development For .Net Dev
iPhone Development For .Net DevAlex Hung
 
Absolute Beginners Guide to iPhone dev
Absolute Beginners Guide to iPhone devAbsolute Beginners Guide to iPhone dev
Absolute Beginners Guide to iPhone devBarry Ezell
 
Challenges In Managing Embedded Product Development
Challenges In Managing Embedded Product DevelopmentChallenges In Managing Embedded Product Development
Challenges In Managing Embedded Product DevelopmentAtul Nene
 
iPhone Development Overview
iPhone Development OverviewiPhone Development Overview
iPhone Development OverviewTom Adams
 
Now is the time to create your own (m)Ruby computer
Now is the time to create your own (m)Ruby computerNow is the time to create your own (m)Ruby computer
Now is the time to create your own (m)Ruby computerkishima7
 
Taller IoT en la Actualidad
Taller IoT en la ActualidadTaller IoT en la Actualidad
Taller IoT en la ActualidadLaurence HR
 
raspberry pi (generalised)
 raspberry pi (generalised) raspberry pi (generalised)
raspberry pi (generalised)Amit Dwivedi
 
CouchDB to the Edge ApacheCon EU
CouchDB to the  Edge ApacheCon EUCouchDB to the  Edge ApacheCon EU
CouchDB to the Edge ApacheCon EUChris Anderson
 
François Cartegnie - VideoLAN - OSL19
François Cartegnie - VideoLAN - OSL19François Cartegnie - VideoLAN - OSL19
François Cartegnie - VideoLAN - OSL19marketingsyone
 
Realtime 3D on the web - a toy or a useful tool?
Realtime 3D on the web - a toy or a useful tool?Realtime 3D on the web - a toy or a useful tool?
Realtime 3D on the web - a toy or a useful tool?Jens Brynildsen
 
nokia and opensource n800
nokia and opensource n800nokia and opensource n800
nokia and opensource n800winsopc
 
Group1 Ss08 Smartphones
Group1 Ss08 SmartphonesGroup1 Ss08 Smartphones
Group1 Ss08 SmartphonesKalun Leung
 
LAS16 100 K1 - Keynote George Grey
LAS16 100 K1 - Keynote George GreyLAS16 100 K1 - Keynote George Grey
LAS16 100 K1 - Keynote George Grey96Boards
 
LAS16-100K1: Welcome Keynote
LAS16-100K1: Welcome KeynoteLAS16-100K1: Welcome Keynote
LAS16-100K1: Welcome KeynoteLinaro
 

Semelhante a A practical guide to connecting hardware to Flex (20)

Connecting Hardware to Flex (360MAX)
Connecting Hardware to Flex (360MAX)Connecting Hardware to Flex (360MAX)
Connecting Hardware to Flex (360MAX)
 
Ubiquitous Content Symposium 2009
Ubiquitous Content Symposium 2009Ubiquitous Content Symposium 2009
Ubiquitous Content Symposium 2009
 
IT Depends: Custom vs Packaged Software
IT Depends: Custom vs Packaged SoftwareIT Depends: Custom vs Packaged Software
IT Depends: Custom vs Packaged Software
 
YCAM Workshop Part 1
YCAM Workshop Part 1YCAM Workshop Part 1
YCAM Workshop Part 1
 
iPhone Development For .Net Dev
iPhone Development For .Net DeviPhone Development For .Net Dev
iPhone Development For .Net Dev
 
Absolute Beginners Guide to iPhone dev
Absolute Beginners Guide to iPhone devAbsolute Beginners Guide to iPhone dev
Absolute Beginners Guide to iPhone dev
 
Cloudera Desktop
Cloudera DesktopCloudera Desktop
Cloudera Desktop
 
Challenges In Managing Embedded Product Development
Challenges In Managing Embedded Product DevelopmentChallenges In Managing Embedded Product Development
Challenges In Managing Embedded Product Development
 
iPhone Development Overview
iPhone Development OverviewiPhone Development Overview
iPhone Development Overview
 
Now is the time to create your own (m)Ruby computer
Now is the time to create your own (m)Ruby computerNow is the time to create your own (m)Ruby computer
Now is the time to create your own (m)Ruby computer
 
Taller IoT en la Actualidad
Taller IoT en la ActualidadTaller IoT en la Actualidad
Taller IoT en la Actualidad
 
dotFes 2008 TOKYO
dotFes 2008 TOKYOdotFes 2008 TOKYO
dotFes 2008 TOKYO
 
raspberry pi (generalised)
 raspberry pi (generalised) raspberry pi (generalised)
raspberry pi (generalised)
 
CouchDB to the Edge ApacheCon EU
CouchDB to the  Edge ApacheCon EUCouchDB to the  Edge ApacheCon EU
CouchDB to the Edge ApacheCon EU
 
François Cartegnie - VideoLAN - OSL19
François Cartegnie - VideoLAN - OSL19François Cartegnie - VideoLAN - OSL19
François Cartegnie - VideoLAN - OSL19
 
Realtime 3D on the web - a toy or a useful tool?
Realtime 3D on the web - a toy or a useful tool?Realtime 3D on the web - a toy or a useful tool?
Realtime 3D on the web - a toy or a useful tool?
 
nokia and opensource n800
nokia and opensource n800nokia and opensource n800
nokia and opensource n800
 
Group1 Ss08 Smartphones
Group1 Ss08 SmartphonesGroup1 Ss08 Smartphones
Group1 Ss08 Smartphones
 
LAS16 100 K1 - Keynote George Grey
LAS16 100 K1 - Keynote George GreyLAS16 100 K1 - Keynote George Grey
LAS16 100 K1 - Keynote George Grey
 
LAS16-100K1: Welcome Keynote
LAS16-100K1: Welcome KeynoteLAS16-100K1: Welcome Keynote
LAS16-100K1: Welcome Keynote
 

Mais de Justin Mclean

ColdFusion Security and Risk Management
ColdFusion Security and Risk ManagementColdFusion Security and Risk Management
ColdFusion Security and Risk ManagementJustin Mclean
 
Connecting RIAs and hardware together
Connecting RIAs and hardware togetherConnecting RIAs and hardware together
Connecting RIAs and hardware togetherJustin Mclean
 
ColdFusion Security and Risk Management
ColdFusion Security and Risk ManagementColdFusion Security and Risk Management
ColdFusion Security and Risk ManagementJustin Mclean
 
Connecting hardware to ColdFusion
Connecting hardware to ColdFusionConnecting hardware to ColdFusion
Connecting hardware to ColdFusionJustin Mclean
 
Connecting open source hardware to the web
Connecting open source hardware to the webConnecting open source hardware to the web
Connecting open source hardware to the webJustin Mclean
 
Putting your device in a browser or on the web
Putting your device in a browser or on the webPutting your device in a browser or on the web
Putting your device in a browser or on the webJustin Mclean
 
Creating an Arduino Web Server from scratch hardware and software
Creating an Arduino Web Server from scratch hardware and softwareCreating an Arduino Web Server from scratch hardware and software
Creating an Arduino Web Server from scratch hardware and softwareJustin Mclean
 
Connecting hardware up to ColdFusion
Connecting hardware up to ColdFusionConnecting hardware up to ColdFusion
Connecting hardware up to ColdFusionJustin Mclean
 

Mais de Justin Mclean (9)

ColdFusion Security and Risk Management
ColdFusion Security and Risk ManagementColdFusion Security and Risk Management
ColdFusion Security and Risk Management
 
Connecting RIAs and hardware together
Connecting RIAs and hardware togetherConnecting RIAs and hardware together
Connecting RIAs and hardware together
 
ColdFusion Security and Risk Management
ColdFusion Security and Risk ManagementColdFusion Security and Risk Management
ColdFusion Security and Risk Management
 
Connecting hardware to ColdFusion
Connecting hardware to ColdFusionConnecting hardware to ColdFusion
Connecting hardware to ColdFusion
 
Connecting open source hardware to the web
Connecting open source hardware to the webConnecting open source hardware to the web
Connecting open source hardware to the web
 
Putting your device in a browser or on the web
Putting your device in a browser or on the webPutting your device in a browser or on the web
Putting your device in a browser or on the web
 
Creating an Arduino Web Server from scratch hardware and software
Creating an Arduino Web Server from scratch hardware and softwareCreating an Arduino Web Server from scratch hardware and software
Creating an Arduino Web Server from scratch hardware and software
 
Connecting hardware up to ColdFusion
Connecting hardware up to ColdFusionConnecting hardware up to ColdFusion
Connecting hardware up to ColdFusion
 
Edge Of The Web
Edge Of The WebEdge Of The Web
Edge Of The Web
 

Último

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 

Último (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 

A practical guide to connecting hardware to Flex

  • 1. Connecting Hardware to Flex A practical guide to connecting open source hardware to Flex Justin Mclean Class Software Friday, 22 May 2009
  • 2. 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
  • 3. Electronics Trends • Low cost small components • More complex components with simple standard interfaces • Cheap low volume board manufacture Friday, 22 May 2009
  • 4. Computing Trends • Easier to program • Use of high level languages • Software tools • Open source Friday, 22 May 2009
  • 5. Communication Trends • Low cost long range wireless • Mesh networks Friday, 22 May 2009
  • 6. 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
  • 7. Arduino Open source hardware and software platform Friday, 22 May 2009
  • 8. Arduino Platform • Open source hardware and software platform • Easy to program • Hardware is flexible, fast, low power and low cost Friday, 22 May 2009
  • 9. Arduino Hardware • Comes in a number of shapes sizes • Low cost • Easy to program • Easy to extend Friday, 22 May 2009
  • 18. 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
  • 20. 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
  • 21. Led Shield Demo Friday, 22 May 2009
  • 22. Led Shield Demo Friday, 22 May 2009
  • 23. Setup and Loop Functions • Setup function called once void setup() { ... } • Loop function called over and over again void loop() { ... } Friday, 22 May 2009
  • 24. 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
  • 25. Flex Flex to Arduino communication Friday, 22 May 2009
  • 26. Layers of Communication • Flex to proxy via an Actionscript library • Proxy to USB communication • USB to arduino Friday, 22 May 2009
  • 27. 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
  • 28. Flex Led Demo Friday, 22 May 2009
  • 29. 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
  • 30. 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
  • 31. Wireless Communication Wireless communication with XBee modems Friday, 22 May 2009
  • 32. XBee Modems • Hardware wireless modem • Low cost • Consume very little power • Good range • Easy to configure Friday, 22 May 2009
  • 34. XBee Networks • Point to point • Point to multipoint • Mesh/Peer to peer Friday, 22 May 2009
  • 35. Funnel IO • Arduino based hardware • Java server • Flex library Friday, 22 May 2009
  • 39. 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
  • 42. 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
  • 43. Issues • Debugging can be hard • No simulator • Memory, power and speed limits • Need a little electronic knowledge Friday, 22 May 2009
  • 44. 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
  • 46. Questions? Ask now, see me after the session or email me at justin@classsoftware.com Friday, 22 May 2009
  • 47. Useful Sites List of useful hardware of software sites Friday, 22 May 2009
  • 48. 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
  • 49. 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
  • 50. 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

Notas do Editor

  1. 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.
  2. 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.
  3. 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
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. $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.
  9. Some of the form factors. Diecimila (standard prototyping), Lillypad (wearable can be sown into clothing), Sanguino (more memory and IO), Mini (postage stamp).
  10. Some of the form factors. Diecimila (standard prototyping), Lillypad (wearable can be sown into clothing), Sanguino (more memory and IO), Mini (postage stamp).
  11. Some of the form factors. Diecimila (standard prototyping), Lillypad (wearable can be sown into clothing), Sanguino (more memory and IO), Mini (postage stamp).
  12. Ethernet shields, prototype shield, GPS shields, home made LED shield.
  13. Ethernet shields, prototype shield, GPS shields, home made LED shield.
  14. Ethernet shields, prototype shield, GPS shields, home made LED shield.
  15. 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.
  16. Simple IDE to write code, manage sketches (projects), compile and upload to the hardware via USB.
  17. 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.
  18. Show Arduino IDE and code, upload software to arduino. Show leds flashing on and off.
  19. All arduino programs has 2 main functions setup + loop
  20. For digital inputs set pin mode to INPUT and use digitalRead function.
  21. 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.
  22. Need 3 layers. Serial communication built into arduino using serial library.
  23. 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.
  24. Load firmata software up to Arduino. Run code from Flex builder.
  25. 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.
  26. Mesh can automatically can form self healing dynamic networks. 100’s or 1000’s of nodes.
  27. Japanese arduino clone. Written more for Flash than Flex not event based so generally need to do some sort of polling.
  28. Demo. Show code. Give to audience member?
  29. Demo. Show code.
  30. While easy there are issues!
  31. Make you a better programmer. Limits of memory and speed.
  32. End slides here! URLs in book. CD software give away. Code on blog.