SlideShare una empresa de Scribd logo
1 de 16
android
                arduino
          and             mixed with
                                   breakout.js




                                @musart
Who am I?

• Embedded System Software Engineer
• Android & Hybrid Application Developer
• PhoneGap Book Author
• twitter : @musart
Today Demo

Turn LED on/off




     ?
Get Button status
Way 1. using Android ADK

                     USB host




• Pros : The simplest way
• Cons : Wired connection
Way 2. using Amarino


                       Bluetooth




• Pros : Wireless connection
• Cons : Bluetooth shield needed
Way 3. breakout.js
             USB
              to
            Serial
                                  WiFi




• Pros : Wireless connection, No more shield
• Cons : Server PC needed
Arduino
         digital
                      • Open Hardware
 usb
serial
                      • 13 digital pin, 6 analog pin
                      • It works standalone with
power                   Power
             analog   • Sketch Tool
breakout.js

      Physical Input

                                     WebApp


     Physical Output


                                     MobileApp




• Connect physical I/O to Web based on Javascript
• Using WebSocket
PhoneGap
             & PhoneGap Plugin


• PhoneGap is HTML5 app platform.
• WebView in Android is not support WebSocket.
• PhoneGap also uses WebView.
• WebSocket is able to be implemented as
  PhoneGap plugin.
Software



       Firmata          Breakout.js Server Breakout.js Client
-C                     - Java                 - Javascript
- use Standard Firmata - webbit, rxtx library - jQuery library
void setup()                  bridge = new SerialBridge    ...
{                               (netPort, this, webRoot,   var IOBoard = BO.IOBoard;
  ...                           isMultiClientEnabled);     var IOBoardEvent =
  Firmata.                    bridge.begin(serialPort,       BO.IOBoardEvent;
    attach(ANALOG_MESSAGE,      57600);                    var LED = BO.io.LED;
    analogWriteCallback);     connectBtn.                  var Button = BO.io.Button;
  Firmata.                      setText("Disconnect");     var ButtonEvent =
    attach(DIGITAL_MESSAGE,   connectBtn.                    BO.io.ButtonEvent;
    digitalWriteCallback);      setActionCommand
  ...                           ("disconnect");            var arduino = new
  Firmata.begin(57600);       if (timer != null) {           IOBoard("192.168.1.2",
  systemResetCallback();        stopPortListTimer();              8890);
}                             }                            var led;
Breakout Javascript API
• Initialize
<script type="text/javascript" src="Breakout.js"></script>

var IOBoard = BO.IOBoard;
var LED = BO.io.LED;
var Button = BO.io.Button;

var arduino = new IOBoard("192.168.1.2", 8890);
var led;

arduino.addEventListener(IOBoardEvent.READY, onReady);

function onReady(event) {
  arduino.removeEventListener(IOBoardEvent.READY, onReady);

    led = new LED(arduino, arduino.getDigitalPin(11));
    var button = new Button(arduino, arduino.getDigitalPin(2));

    button.addEventListener(ButtonEvent.PRESS, onPress);
    button.addEventListener(ButtonEvent.RELEASE, onRelease);
}
Breakout Javascript API
• LED
// led = new LED(arduino, arduino.getDigitalPin(11));
function turnLedOn(evt) {
  led.on();
}
function turnLedOff(evt) {
  led.off();
}


• Button
// var button = new Button(arduino, arduino.getDigitalPin(2));
// button.addEventListener(ButtonEvent.PRESS, onPress);
// button.addEventListener(ButtonEvent.RELEASE, onRelease);
function onPress(evt) {
  var btn = evt.target;
  $('#state').html("Button "+ btn.pinNumber +" state: Pressed");
}
function onRelease(evt) {
  var btn = evt.target;
  $('#state').html("Button "+ btn.pinNumber +" state:Released");
}
Demo
Many Combinations available


   Firmata          Breakout.js Server   Breakout.js Client
                                            PhoneGap App

                                          Web App, Hybrid App




  Arduino Nano
                        Raspberry Pi




Arduino Mega 2560       Baegle Board
Reference Sites

•   Breakout.js : http://breakoutjs.com/

•   PhoneGap : http://phonegap.com/

•   PhoneGap Plugin : https://github.com/anismiles/websocket-
    android-phonegap

•   Firmata : http://firmata.org/wiki/Main_Page

•   Amernio : http://www.amarino-toolkit.net/

•   Android ADK : http://developer.android.com/guide/topics/
    usb/adk.html

•   Funnel : http://funnel.cc/
Thanks
@musart

Más contenido relacionado

La actualidad más candente

JavaScript in the Real World
JavaScript in the Real WorldJavaScript in the Real World
JavaScript in the Real WorldAndrew Nesbitt
 
Lets make robots
Lets make robotsLets make robots
Lets make robotsSudar Muthu
 
Testing nodejs apps
Testing nodejs appsTesting nodejs apps
Testing nodejs appsfelipefsilva
 
Asynchronous Module Definition (AMD)
Asynchronous Module Definition (AMD)Asynchronous Module Definition (AMD)
Asynchronous Module Definition (AMD)xMartin12
 
Build Lifecycle Craftsmanship for the Transylvania JUG
Build Lifecycle Craftsmanship for the Transylvania JUGBuild Lifecycle Craftsmanship for the Transylvania JUG
Build Lifecycle Craftsmanship for the Transylvania JUGMatthew McCullough
 
NodeJS: n00b no more
NodeJS: n00b no moreNodeJS: n00b no more
NodeJS: n00b no moreBen Peachey
 
Windows Azure loves OSS
Windows Azure loves OSSWindows Azure loves OSS
Windows Azure loves OSSKazumi Hirose
 
Detecting headless browsers
Detecting headless browsersDetecting headless browsers
Detecting headless browsersSergey Shekyan
 
No Hugging, No Learning
No Hugging, No LearningNo Hugging, No Learning
No Hugging, No LearningOlaf Alders
 
Introducing to node.js
Introducing to node.jsIntroducing to node.js
Introducing to node.jsJeongHun Byeon
 
Let s Enjoy Node.js
Let s Enjoy Node.jsLet s Enjoy Node.js
Let s Enjoy Node.jsFred Chien
 
The MetaCPAN VM Part II (Using the VM)
The MetaCPAN VM Part II (Using the VM)The MetaCPAN VM Part II (Using the VM)
The MetaCPAN VM Part II (Using the VM)Olaf Alders
 
Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environmentbocribbz
 
CasperJS and PhantomJS for Automated Testing
CasperJS and PhantomJS for Automated TestingCasperJS and PhantomJS for Automated Testing
CasperJS and PhantomJS for Automated TestingX-Team
 
Building websites with Node.ACS
Building websites with Node.ACSBuilding websites with Node.ACS
Building websites with Node.ACSRicardo Alcocer
 

La actualidad más candente (20)

JavaScript in the Real World
JavaScript in the Real WorldJavaScript in the Real World
JavaScript in the Real World
 
Lets make robots
Lets make robotsLets make robots
Lets make robots
 
Testing nodejs apps
Testing nodejs appsTesting nodejs apps
Testing nodejs apps
 
Asynchronous Module Definition (AMD)
Asynchronous Module Definition (AMD)Asynchronous Module Definition (AMD)
Asynchronous Module Definition (AMD)
 
Build Lifecycle Craftsmanship for the Transylvania JUG
Build Lifecycle Craftsmanship for the Transylvania JUGBuild Lifecycle Craftsmanship for the Transylvania JUG
Build Lifecycle Craftsmanship for the Transylvania JUG
 
NodeJS: n00b no more
NodeJS: n00b no moreNodeJS: n00b no more
NodeJS: n00b no more
 
Windows Azure loves OSS
Windows Azure loves OSSWindows Azure loves OSS
Windows Azure loves OSS
 
Detecting headless browsers
Detecting headless browsersDetecting headless browsers
Detecting headless browsers
 
No Hugging, No Learning
No Hugging, No LearningNo Hugging, No Learning
No Hugging, No Learning
 
Introducing to node.js
Introducing to node.jsIntroducing to node.js
Introducing to node.js
 
The SPDY Protocol
The SPDY ProtocolThe SPDY Protocol
The SPDY Protocol
 
Node ppt
Node pptNode ppt
Node ppt
 
Let s Enjoy Node.js
Let s Enjoy Node.jsLet s Enjoy Node.js
Let s Enjoy Node.js
 
The MetaCPAN VM Part II (Using the VM)
The MetaCPAN VM Part II (Using the VM)The MetaCPAN VM Part II (Using the VM)
The MetaCPAN VM Part II (Using the VM)
 
Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environment
 
CasperJS and PhantomJS for Automated Testing
CasperJS and PhantomJS for Automated TestingCasperJS and PhantomJS for Automated Testing
CasperJS and PhantomJS for Automated Testing
 
Mojolicious lite
Mojolicious liteMojolicious lite
Mojolicious lite
 
Node
NodeNode
Node
 
Building websites with Node.ACS
Building websites with Node.ACSBuilding websites with Node.ACS
Building websites with Node.ACS
 
Mangling
Mangling Mangling
Mangling
 

Similar a Android and Arduio mixed with Breakout js

.Net Gadgeteer
.Net Gadgeteer .Net Gadgeteer
.Net Gadgeteer Wade Zhu
 
Firefox OS, fixing the mobile web - FITC Toronto - 2014-04-28
Firefox OS, fixing the mobile web - FITC Toronto - 2014-04-28Firefox OS, fixing the mobile web - FITC Toronto - 2014-04-28
Firefox OS, fixing the mobile web - FITC Toronto - 2014-04-28Frédéric Harper
 
Firefox OS, HTML5 to the next level - Python Montreal - 2014-05-12
Firefox OS, HTML5 to the next level - Python Montreal - 2014-05-12Firefox OS, HTML5 to the next level - Python Montreal - 2014-05-12
Firefox OS, HTML5 to the next level - Python Montreal - 2014-05-12Frédéric Harper
 
Hybrid application development
Hybrid application developmentHybrid application development
Hybrid application developmentEngin Hatay
 
Android Things, from mobile apps to physical world - Stefano Sanna - Giovanni...
Android Things, from mobile apps to physical world - Stefano Sanna - Giovanni...Android Things, from mobile apps to physical world - Stefano Sanna - Giovanni...
Android Things, from mobile apps to physical world - Stefano Sanna - Giovanni...Codemotion
 
Android Things, from mobile apps to physical world by Giovanni Di Gialluca an...
Android Things, from mobile apps to physical world by Giovanni Di Gialluca an...Android Things, from mobile apps to physical world by Giovanni Di Gialluca an...
Android Things, from mobile apps to physical world by Giovanni Di Gialluca an...Codemotion
 
Android Things, from mobile apps to physical world
Android Things, from mobile apps to physical worldAndroid Things, from mobile apps to physical world
Android Things, from mobile apps to physical worldStefano Sanna
 
iOS Bluetooth Low Energy (BLE) Remote Robot Interface
iOS Bluetooth Low Energy (BLE) Remote Robot InterfaceiOS Bluetooth Low Energy (BLE) Remote Robot Interface
iOS Bluetooth Low Energy (BLE) Remote Robot InterfaceSteve Knodl
 
Øredev2013 - FirefoxOS - the platform HTML5 deserves
Øredev2013 - FirefoxOS - the platform HTML5 deservesØredev2013 - FirefoxOS - the platform HTML5 deserves
Øredev2013 - FirefoxOS - the platform HTML5 deservesChristian Heilmann
 
Iphone Presentation for MuMe09
Iphone Presentation for MuMe09Iphone Presentation for MuMe09
Iphone Presentation for MuMe09Gonzalo Parra
 
Better With Friends: Android+NFC+Arduino
Better With Friends: Android+NFC+ArduinoBetter With Friends: Android+NFC+Arduino
Better With Friends: Android+NFC+ArduinoPearl Chen
 
ITT 2014 - Erik Hellmann - Android Programming - Smarter and Better Networking
ITT 2014 - Erik Hellmann - Android Programming - Smarter and Better NetworkingITT 2014 - Erik Hellmann - Android Programming - Smarter and Better Networking
ITT 2014 - Erik Hellmann - Android Programming - Smarter and Better NetworkingIstanbul Tech Talks
 
Mobile is slow - Over the Air 2013
Mobile is slow - Over the Air 2013Mobile is slow - Over the Air 2013
Mobile is slow - Over the Air 2013Jon Arne Sæterås
 
So you want to build a mobile app - HTML5 vs. Native @ the Boston Mobile Expe...
So you want to build a mobile app - HTML5 vs. Native @ the Boston Mobile Expe...So you want to build a mobile app - HTML5 vs. Native @ the Boston Mobile Expe...
So you want to build a mobile app - HTML5 vs. Native @ the Boston Mobile Expe...Yottaa
 
[HES2013] Hacking apple accessories to pown iDevices – Wake up Neo! Your phon...
[HES2013] Hacking apple accessories to pown iDevices – Wake up Neo! Your phon...[HES2013] Hacking apple accessories to pown iDevices – Wake up Neo! Your phon...
[HES2013] Hacking apple accessories to pown iDevices – Wake up Neo! Your phon...Hackito Ergo Sum
 
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023Peter Gallagher
 
HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07
HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07
HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07Frédéric Harper
 
Android Things in action
Android Things in actionAndroid Things in action
Android Things in actionStefano Sanna
 
Swift hardware hacking @ try! Swift
Swift hardware hacking @ try! SwiftSwift hardware hacking @ try! Swift
Swift hardware hacking @ try! SwiftSally Shepard
 

Similar a Android and Arduio mixed with Breakout js (20)

.Net Gadgeteer
.Net Gadgeteer .Net Gadgeteer
.Net Gadgeteer
 
Firefox OS, fixing the mobile web - FITC Toronto - 2014-04-28
Firefox OS, fixing the mobile web - FITC Toronto - 2014-04-28Firefox OS, fixing the mobile web - FITC Toronto - 2014-04-28
Firefox OS, fixing the mobile web - FITC Toronto - 2014-04-28
 
Firefox OS, HTML5 to the next level - Python Montreal - 2014-05-12
Firefox OS, HTML5 to the next level - Python Montreal - 2014-05-12Firefox OS, HTML5 to the next level - Python Montreal - 2014-05-12
Firefox OS, HTML5 to the next level - Python Montreal - 2014-05-12
 
Hybrid application development
Hybrid application developmentHybrid application development
Hybrid application development
 
Android Things, from mobile apps to physical world - Stefano Sanna - Giovanni...
Android Things, from mobile apps to physical world - Stefano Sanna - Giovanni...Android Things, from mobile apps to physical world - Stefano Sanna - Giovanni...
Android Things, from mobile apps to physical world - Stefano Sanna - Giovanni...
 
Android Things, from mobile apps to physical world by Giovanni Di Gialluca an...
Android Things, from mobile apps to physical world by Giovanni Di Gialluca an...Android Things, from mobile apps to physical world by Giovanni Di Gialluca an...
Android Things, from mobile apps to physical world by Giovanni Di Gialluca an...
 
Android Things, from mobile apps to physical world
Android Things, from mobile apps to physical worldAndroid Things, from mobile apps to physical world
Android Things, from mobile apps to physical world
 
iOS Bluetooth Low Energy (BLE) Remote Robot Interface
iOS Bluetooth Low Energy (BLE) Remote Robot InterfaceiOS Bluetooth Low Energy (BLE) Remote Robot Interface
iOS Bluetooth Low Energy (BLE) Remote Robot Interface
 
IoT on Raspberry Pi
IoT on Raspberry PiIoT on Raspberry Pi
IoT on Raspberry Pi
 
Øredev2013 - FirefoxOS - the platform HTML5 deserves
Øredev2013 - FirefoxOS - the platform HTML5 deservesØredev2013 - FirefoxOS - the platform HTML5 deserves
Øredev2013 - FirefoxOS - the platform HTML5 deserves
 
Iphone Presentation for MuMe09
Iphone Presentation for MuMe09Iphone Presentation for MuMe09
Iphone Presentation for MuMe09
 
Better With Friends: Android+NFC+Arduino
Better With Friends: Android+NFC+ArduinoBetter With Friends: Android+NFC+Arduino
Better With Friends: Android+NFC+Arduino
 
ITT 2014 - Erik Hellmann - Android Programming - Smarter and Better Networking
ITT 2014 - Erik Hellmann - Android Programming - Smarter and Better NetworkingITT 2014 - Erik Hellmann - Android Programming - Smarter and Better Networking
ITT 2014 - Erik Hellmann - Android Programming - Smarter and Better Networking
 
Mobile is slow - Over the Air 2013
Mobile is slow - Over the Air 2013Mobile is slow - Over the Air 2013
Mobile is slow - Over the Air 2013
 
So you want to build a mobile app - HTML5 vs. Native @ the Boston Mobile Expe...
So you want to build a mobile app - HTML5 vs. Native @ the Boston Mobile Expe...So you want to build a mobile app - HTML5 vs. Native @ the Boston Mobile Expe...
So you want to build a mobile app - HTML5 vs. Native @ the Boston Mobile Expe...
 
[HES2013] Hacking apple accessories to pown iDevices – Wake up Neo! Your phon...
[HES2013] Hacking apple accessories to pown iDevices – Wake up Neo! Your phon...[HES2013] Hacking apple accessories to pown iDevices – Wake up Neo! Your phon...
[HES2013] Hacking apple accessories to pown iDevices – Wake up Neo! Your phon...
 
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023
 
HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07
HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07
HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07
 
Android Things in action
Android Things in actionAndroid Things in action
Android Things in action
 
Swift hardware hacking @ try! Swift
Swift hardware hacking @ try! SwiftSwift hardware hacking @ try! Swift
Swift hardware hacking @ try! Swift
 

Último

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
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
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
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
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 

Último (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
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
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
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
 
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...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

Android and Arduio mixed with Breakout js

  • 1. android arduino and mixed with breakout.js @musart
  • 2. Who am I? • Embedded System Software Engineer • Android & Hybrid Application Developer • PhoneGap Book Author • twitter : @musart
  • 3. Today Demo Turn LED on/off ? Get Button status
  • 4. Way 1. using Android ADK USB host • Pros : The simplest way • Cons : Wired connection
  • 5. Way 2. using Amarino Bluetooth • Pros : Wireless connection • Cons : Bluetooth shield needed
  • 6. Way 3. breakout.js USB to Serial WiFi • Pros : Wireless connection, No more shield • Cons : Server PC needed
  • 7. Arduino digital • Open Hardware usb serial • 13 digital pin, 6 analog pin • It works standalone with power Power analog • Sketch Tool
  • 8. breakout.js Physical Input WebApp Physical Output MobileApp • Connect physical I/O to Web based on Javascript • Using WebSocket
  • 9. PhoneGap & PhoneGap Plugin • PhoneGap is HTML5 app platform. • WebView in Android is not support WebSocket. • PhoneGap also uses WebView. • WebSocket is able to be implemented as PhoneGap plugin.
  • 10. Software Firmata Breakout.js Server Breakout.js Client -C - Java - Javascript - use Standard Firmata - webbit, rxtx library - jQuery library void setup() bridge = new SerialBridge ... { (netPort, this, webRoot, var IOBoard = BO.IOBoard; ... isMultiClientEnabled); var IOBoardEvent = Firmata. bridge.begin(serialPort, BO.IOBoardEvent; attach(ANALOG_MESSAGE, 57600); var LED = BO.io.LED; analogWriteCallback); connectBtn. var Button = BO.io.Button; Firmata. setText("Disconnect"); var ButtonEvent = attach(DIGITAL_MESSAGE, connectBtn. BO.io.ButtonEvent; digitalWriteCallback); setActionCommand ... ("disconnect"); var arduino = new Firmata.begin(57600); if (timer != null) { IOBoard("192.168.1.2", systemResetCallback(); stopPortListTimer(); 8890); } } var led;
  • 11. Breakout Javascript API • Initialize <script type="text/javascript" src="Breakout.js"></script> var IOBoard = BO.IOBoard; var LED = BO.io.LED; var Button = BO.io.Button; var arduino = new IOBoard("192.168.1.2", 8890); var led; arduino.addEventListener(IOBoardEvent.READY, onReady); function onReady(event) { arduino.removeEventListener(IOBoardEvent.READY, onReady); led = new LED(arduino, arduino.getDigitalPin(11)); var button = new Button(arduino, arduino.getDigitalPin(2)); button.addEventListener(ButtonEvent.PRESS, onPress); button.addEventListener(ButtonEvent.RELEASE, onRelease); }
  • 12. Breakout Javascript API • LED // led = new LED(arduino, arduino.getDigitalPin(11)); function turnLedOn(evt) { led.on(); } function turnLedOff(evt) { led.off(); } • Button // var button = new Button(arduino, arduino.getDigitalPin(2)); // button.addEventListener(ButtonEvent.PRESS, onPress); // button.addEventListener(ButtonEvent.RELEASE, onRelease); function onPress(evt) { var btn = evt.target; $('#state').html("Button "+ btn.pinNumber +" state: Pressed"); } function onRelease(evt) { var btn = evt.target; $('#state').html("Button "+ btn.pinNumber +" state:Released"); }
  • 13. Demo
  • 14. Many Combinations available Firmata Breakout.js Server Breakout.js Client PhoneGap App Web App, Hybrid App Arduino Nano Raspberry Pi Arduino Mega 2560 Baegle Board
  • 15. Reference Sites • Breakout.js : http://breakoutjs.com/ • PhoneGap : http://phonegap.com/ • PhoneGap Plugin : https://github.com/anismiles/websocket- android-phonegap • Firmata : http://firmata.org/wiki/Main_Page • Amernio : http://www.amarino-toolkit.net/ • Android ADK : http://developer.android.com/guide/topics/ usb/adk.html • Funnel : http://funnel.cc/

Notas del editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n