SlideShare uma empresa Scribd logo
1 de 57
Baixar para ler offline
Connecting Hardware to
                          ColdFusion
                          Justin Mclean
                          Email: justin@classsoftware.com
                          Twitter: @justinmclean
                          Blog: http://blog.classsoftware.com




Saturday, 24 April 2010
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
                     • Adobe certified developer and trainer in
                          ColdFusion and Flex
                     • Based in Sydney Australia




Saturday, 24 April 2010
Electronics Trends
                     • Low cost components
                     • Small components
                     • Complex components with simple standard
                          interfaces




Saturday, 24 April 2010
Computing Trends
                     •    Easier to program
                     •    Use of high level languages
                     •    Software tools
                     •    Open source




Saturday, 24 April 2010
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




Saturday, 24 April 2010
Arduino
                          Overview of the Arduino Platform




Saturday, 24 April 2010
Arduino Platform
                     • Open source hardware and software platform
                     • Easy to program
                     • Hardware is flexible, fast, low power and low cost




Saturday, 24 April 2010
Arduino Hardware
                     • Comes in a number of shapes sizes
                     • Low cost
                     • Easy to extend




Saturday, 24 April 2010
Arduino Boards




Saturday, 24 April 2010
Arduino Boards




Saturday, 24 April 2010
Arduino Boards




Saturday, 24 April 2010
Arduino Boards




Saturday, 24 April 2010
Arduino Shields




Saturday, 24 April 2010
Arduino Shields




Saturday, 24 April 2010
Arduino Shields




Saturday, 24 April 2010
Arduino Shields




Saturday, 24 April 2010
Arduino Software Platform
                     •    Open source cross platform IDE
                     •    Alpha but very stable
                     •    Updated frequently
                     •    Growing and active community




Saturday, 24 April 2010
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




Saturday, 24 April 2010
Arduino IDE




Saturday, 24 April 2010
Led Shield Demo




Saturday, 24 April 2010
Led Shield Demo




Saturday, 24 April 2010
Issues
                     •    Debugging can be hard
                     •    No simulator
                     •    Memory, power and speed limits
                     •    Helps to have a little electronics knowledge




Saturday, 24 April 2010
Connecting
                          ColdFusion
                          How to communicate between
                          ColdFusion and the Arduino Platform




Saturday, 24 April 2010
ColdFusion Communication
                     • ColdFusion can’t easily talk USB
                     • Use a socket to USB proxy
                     • ColdFusion can’t easily talk raw sockets




Saturday, 24 April 2010
Layers of Communication
                     • ColdFusion to proxy via Java/CFML code
                     • Proxy to USB communication
                     • USB to Arduino




Saturday, 24 April 2010
Connection Diagram

                                               Computer                       Arduino




                            Application Code                                  Arduino




                          Function Calls and
                                                                               Code
                                Events


                                                TCP/IP                USB
                                Library                   USB Proxy           Firmata
                                                Socket                Cable




Saturday, 24 April 2010
Firmata Protocol
                     •    Simple Binary Protocol
                     •    Based on MIDI
                     •    Easy to extend
                     •    Standard Arduino software library




Saturday, 24 April 2010
Firmata Protocol
                                  Type     Command    MIDI   Byte #1     Btye #2

                          Analog           0xE0      pin     Bits 0-6   Bits 7-13

                          Digital          0x90      port    Bits 0-6   Bits 7-13

                          Report Analog    0xC0      pin     0 or 1

                          Report Digital   0xD0      port    0 or 1

                          Pin Mode         0xF4      port    0 or 1

                          Version          0xF9

                          Reset            0xFF




Saturday, 24 April 2010
ColdFusion Socket
                     • Mixed Java/CFML code
                     • ColdFusion 8 or 9 makes it easy




Saturday, 24 April 2010
ColdFusion Arduino
                     •    Alpha software
                     •    ColdFusion implementation of Firmata
                     •    Read analog values
                     •    Read/write digital values




Saturday, 24 April 2010
ColdFusion Arduino Demo




Saturday, 24 April 2010
Issues
                     •    Arduino startup time
                     •    Auto reset
                     •    Not a persistent connect
                     •    Proxy must be running on machine Arduino is
                          connected to
                     • Use under load




Saturday, 24 April 2010
Ethernet
                          Using Arduino Ethernet Shields




Saturday, 24 April 2010
Ethernet Shields
                     •    Allow direct internet connection
                     •    No dedicated PC needed
                     •    Shields need a little config
                     •    Can act as web server or client




Saturday, 24 April 2010
Ethernet Shields




Saturday, 24 April 2010
Ethernet Shields




Saturday, 24 April 2010
Ethernet Shields




Saturday, 24 April 2010
Ethernet Arduino Code
                     • Can run as web server
                     • Code easy to write or modify




Saturday, 24 April 2010
ColdFusion Code
                     •    CFHTTP to get data
                     •    Data returned as XML
                     •    Parse XML via ParseXML()
                     •    Display or act on values




Saturday, 24 April 2010
ColdFusion Ethernet Demo




Saturday, 24 April 2010
Pachube
                          An easier way to connect Arduinos




Saturday, 24 April 2010
Pachube
                     •    Store and share and access realtime sensor data
                     •    Simple and secure
                     •    API to interact with all data and services
                     •    Graphs and maps




Saturday, 24 April 2010
Pachube




Saturday, 24 April 2010
Pachube




Saturday, 24 April 2010
Pachube




Saturday, 24 April 2010
Pachube API
                     •    Communicates HTTP
                     •    Plain text (csv), XML or Jason
                     •    REST based
                     •    Large base of supported languages




Saturday, 24 April 2010
Pachube Arduino Code
                     • Runs on Arduino with ethernet shield
                     • Sends values to Pachube
                     • Can request values directly or via Pachube




Saturday, 24 April 2010
ColdFusion
                     •    Call pachube API using CFHTTP
                     •    ParseXML()
                     •    XML is in EEML format
                     •    Display or act on values




Saturday, 24 April 2010
Demo




Saturday, 24 April 2010
Pachube Triggers
                     • Pachube can call an URL when an analog or
                          digital value changes or goes over or under a
                          value
                     • The URL can be ColdFusion URL




Saturday, 24 April 2010
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




Saturday, 24 April 2010
It’s Fun!


Saturday, 24 April 2010
Questions?
                          Ask now, see me after session or email
                          justin@classsoftware.com




Saturday, 24 April 2010
Useful Sites
                          List of useful hardware and software sites




Saturday, 24 April 2010
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/




Saturday, 24 April 2010
Hardware Sites
                     • Spark Fun (US) http://www.sparcfun.com/
                     • Adafruit Industries (US) http://
                          www.adafruit.com/
                     • Electronic Goldmine (US) http://www.goldmine-
                          elec.com/




Saturday, 24 April 2010
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/




Saturday, 24 April 2010

Mais conteúdo relacionado

Semelhante a Connecting hardware to ColdFusion

Hacking Meatspace with Arduino and pyFirmata
Hacking Meatspace with Arduino and pyFirmataHacking Meatspace with Arduino and pyFirmata
Hacking Meatspace with Arduino and pyFirmataChes Martin
 
Connecting hardware up to ColdFusion
Connecting hardware up to ColdFusionConnecting hardware up to ColdFusion
Connecting hardware up to ColdFusionJustin Mclean
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Webelliando dias
 
Implementation of an Arduino Remote Laboratory with Raspberry Pi
Implementation of an Arduino Remote Laboratory with Raspberry PiImplementation of an Arduino Remote Laboratory with Raspberry Pi
Implementation of an Arduino Remote Laboratory with Raspberry PiManuel Castro
 
11_04_2019 EDUCON Award: "Implementation of an arduino remoto laboratory with...
11_04_2019 EDUCON Award: "Implementation of an arduino remoto laboratory with...11_04_2019 EDUCON Award: "Implementation of an arduino remoto laboratory with...
11_04_2019 EDUCON Award: "Implementation of an arduino remoto laboratory with...eMadrid network
 
Connecting Hardware to Flex (360MAX)
Connecting Hardware to Flex (360MAX)Connecting Hardware to Flex (360MAX)
Connecting Hardware to Flex (360MAX)Justin Mclean
 
02 - Getting Started with Arduino.pptx
02 - Getting Started with Arduino.pptx02 - Getting Started with Arduino.pptx
02 - Getting Started with Arduino.pptxssuser7effe0
 
Taller IoT en la Actualidad
Taller IoT en la ActualidadTaller IoT en la Actualidad
Taller IoT en la ActualidadLaurence HR
 
Build IoT Applications with C#
Build IoT Applications with C#Build IoT Applications with C#
Build IoT Applications with C#Ken Samson, MISM
 
Introduction to arduino
Introduction to arduinoIntroduction to arduino
Introduction to arduinoPreet Sangha
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino동호 손
 
Robots conf microcontroller and iot survey
Robots conf   microcontroller and iot surveyRobots conf   microcontroller and iot survey
Robots conf microcontroller and iot surveyMatt Haines
 
ch4-Software is Everywhere
ch4-Software is Everywherech4-Software is Everywhere
ch4-Software is Everywheressuser06ea42
 
Open Source and the Internet of Things
Open Source and the Internet of ThingsOpen Source and the Internet of Things
Open Source and the Internet of ThingsBlack Duck by Synopsys
 
WebRTC, RED and Janus @ ClueCon21
WebRTC, RED and Janus @ ClueCon21WebRTC, RED and Janus @ ClueCon21
WebRTC, RED and Janus @ ClueCon21Lorenzo Miniero
 
Null mumbai-iot-workshop
Null mumbai-iot-workshopNull mumbai-iot-workshop
Null mumbai-iot-workshopNitesh Malviya
 
Getting Started with Pinoccio
Getting Started with PinoccioGetting Started with Pinoccio
Getting Started with Pinocciofcohenvotsh
 
Raspberry Pi, Arduino and the Maker Movement
Raspberry Pi, Arduino and the Maker MovementRaspberry Pi, Arduino and the Maker Movement
Raspberry Pi, Arduino and the Maker Movementsrmonk
 

Semelhante a Connecting hardware to ColdFusion (20)

Hacking Meatspace with Arduino and pyFirmata
Hacking Meatspace with Arduino and pyFirmataHacking Meatspace with Arduino and pyFirmata
Hacking Meatspace with Arduino and pyFirmata
 
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
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Web
 
Implementation of an Arduino Remote Laboratory with Raspberry Pi
Implementation of an Arduino Remote Laboratory with Raspberry PiImplementation of an Arduino Remote Laboratory with Raspberry Pi
Implementation of an Arduino Remote Laboratory with Raspberry Pi
 
11_04_2019 EDUCON Award: "Implementation of an arduino remoto laboratory with...
11_04_2019 EDUCON Award: "Implementation of an arduino remoto laboratory with...11_04_2019 EDUCON Award: "Implementation of an arduino remoto laboratory with...
11_04_2019 EDUCON Award: "Implementation of an arduino remoto laboratory with...
 
Connecting Hardware to Flex (360MAX)
Connecting Hardware to Flex (360MAX)Connecting Hardware to Flex (360MAX)
Connecting Hardware to Flex (360MAX)
 
02 - Getting Started with Arduino.pptx
02 - Getting Started with Arduino.pptx02 - Getting Started with Arduino.pptx
02 - Getting Started with Arduino.pptx
 
Taller IoT en la Actualidad
Taller IoT en la ActualidadTaller IoT en la Actualidad
Taller IoT en la Actualidad
 
Build IoT Applications with C#
Build IoT Applications with C#Build IoT Applications with C#
Build IoT Applications with C#
 
Introduction to arduino
Introduction to arduinoIntroduction to arduino
Introduction to arduino
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Robots conf microcontroller and iot survey
Robots conf   microcontroller and iot surveyRobots conf   microcontroller and iot survey
Robots conf microcontroller and iot survey
 
ch4-Software is Everywhere
ch4-Software is Everywherech4-Software is Everywhere
ch4-Software is Everywhere
 
Open Source and the Internet of Things
Open Source and the Internet of ThingsOpen Source and the Internet of Things
Open Source and the Internet of Things
 
WebRTC, RED and Janus @ ClueCon21
WebRTC, RED and Janus @ ClueCon21WebRTC, RED and Janus @ ClueCon21
WebRTC, RED and Janus @ ClueCon21
 
Null mumbai-iot-workshop
Null mumbai-iot-workshopNull mumbai-iot-workshop
Null mumbai-iot-workshop
 
External Editors for Arduino
External Editors for ArduinoExternal Editors for Arduino
External Editors for Arduino
 
Getting Started with Pinoccio
Getting Started with PinoccioGetting Started with Pinoccio
Getting Started with Pinoccio
 
Raspberry Pi, Arduino and the Maker Movement
Raspberry Pi, Arduino and the Maker MovementRaspberry Pi, Arduino and the Maker Movement
Raspberry Pi, Arduino and the Maker Movement
 

Último

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 

Último (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

Connecting hardware to ColdFusion

  • 1. Connecting Hardware to ColdFusion Justin Mclean Email: justin@classsoftware.com Twitter: @justinmclean Blog: http://blog.classsoftware.com Saturday, 24 April 2010
  • 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 • Adobe certified developer and trainer in ColdFusion and Flex • Based in Sydney Australia Saturday, 24 April 2010
  • 3. Electronics Trends • Low cost components • Small components • Complex components with simple standard interfaces Saturday, 24 April 2010
  • 4. Computing Trends • Easier to program • Use of high level languages • Software tools • Open source Saturday, 24 April 2010
  • 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 Saturday, 24 April 2010
  • 6. Arduino Overview of the Arduino Platform Saturday, 24 April 2010
  • 7. Arduino Platform • Open source hardware and software platform • Easy to program • Hardware is flexible, fast, low power and low cost Saturday, 24 April 2010
  • 8. Arduino Hardware • Comes in a number of shapes sizes • Low cost • Easy to extend Saturday, 24 April 2010
  • 17. Arduino Software Platform • Open source cross platform IDE • Alpha but very stable • Updated frequently • Growing and active community Saturday, 24 April 2010
  • 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 Saturday, 24 April 2010
  • 20. Led Shield Demo Saturday, 24 April 2010
  • 21. Led Shield Demo Saturday, 24 April 2010
  • 22. Issues • Debugging can be hard • No simulator • Memory, power and speed limits • Helps to have a little electronics knowledge Saturday, 24 April 2010
  • 23. Connecting ColdFusion How to communicate between ColdFusion and the Arduino Platform Saturday, 24 April 2010
  • 24. ColdFusion Communication • ColdFusion can’t easily talk USB • Use a socket to USB proxy • ColdFusion can’t easily talk raw sockets Saturday, 24 April 2010
  • 25. Layers of Communication • ColdFusion to proxy via Java/CFML code • Proxy to USB communication • USB to Arduino Saturday, 24 April 2010
  • 26. Connection Diagram Computer Arduino Application Code Arduino Function Calls and Code Events TCP/IP USB Library USB Proxy Firmata Socket Cable Saturday, 24 April 2010
  • 27. Firmata Protocol • Simple Binary Protocol • Based on MIDI • Easy to extend • Standard Arduino software library Saturday, 24 April 2010
  • 28. Firmata Protocol Type Command MIDI Byte #1 Btye #2 Analog 0xE0 pin Bits 0-6 Bits 7-13 Digital 0x90 port Bits 0-6 Bits 7-13 Report Analog 0xC0 pin 0 or 1 Report Digital 0xD0 port 0 or 1 Pin Mode 0xF4 port 0 or 1 Version 0xF9 Reset 0xFF Saturday, 24 April 2010
  • 29. ColdFusion Socket • Mixed Java/CFML code • ColdFusion 8 or 9 makes it easy Saturday, 24 April 2010
  • 30. ColdFusion Arduino • Alpha software • ColdFusion implementation of Firmata • Read analog values • Read/write digital values Saturday, 24 April 2010
  • 32. Issues • Arduino startup time • Auto reset • Not a persistent connect • Proxy must be running on machine Arduino is connected to • Use under load Saturday, 24 April 2010
  • 33. Ethernet Using Arduino Ethernet Shields Saturday, 24 April 2010
  • 34. Ethernet Shields • Allow direct internet connection • No dedicated PC needed • Shields need a little config • Can act as web server or client Saturday, 24 April 2010
  • 38. Ethernet Arduino Code • Can run as web server • Code easy to write or modify Saturday, 24 April 2010
  • 39. ColdFusion Code • CFHTTP to get data • Data returned as XML • Parse XML via ParseXML() • Display or act on values Saturday, 24 April 2010
  • 41. Pachube An easier way to connect Arduinos Saturday, 24 April 2010
  • 42. Pachube • Store and share and access realtime sensor data • Simple and secure • API to interact with all data and services • Graphs and maps Saturday, 24 April 2010
  • 46. Pachube API • Communicates HTTP • Plain text (csv), XML or Jason • REST based • Large base of supported languages Saturday, 24 April 2010
  • 47. Pachube Arduino Code • Runs on Arduino with ethernet shield • Sends values to Pachube • Can request values directly or via Pachube Saturday, 24 April 2010
  • 48. ColdFusion • Call pachube API using CFHTTP • ParseXML() • XML is in EEML format • Display or act on values Saturday, 24 April 2010
  • 50. Pachube Triggers • Pachube can call an URL when an analog or digital value changes or goes over or under a value • The URL can be ColdFusion URL Saturday, 24 April 2010
  • 51. 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 Saturday, 24 April 2010
  • 53. Questions? Ask now, see me after session or email justin@classsoftware.com Saturday, 24 April 2010
  • 54. Useful Sites List of useful hardware and software sites Saturday, 24 April 2010
  • 55. 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/ Saturday, 24 April 2010
  • 56. Hardware Sites • Spark Fun (US) http://www.sparcfun.com/ • Adafruit Industries (US) http:// www.adafruit.com/ • Electronic Goldmine (US) http://www.goldmine- elec.com/ Saturday, 24 April 2010
  • 57. 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/ Saturday, 24 April 2010