SlideShare a Scribd company logo
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

More Related Content

What's hot

JavaScript in the Real World
JavaScript in the Real WorldJavaScript in the Real World
JavaScript in the Real World
Andrew Nesbitt
 
Lets make robots
Lets make robotsLets make robots
Lets make robots
Sudar Muthu
 
Testing nodejs apps
Testing nodejs appsTesting nodejs apps
Testing nodejs apps
felipefsilva
 
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 JUG
Matthew McCullough
 
NodeJS: n00b no more
NodeJS: n00b no moreNodeJS: n00b no more
NodeJS: n00b no more
Ben Peachey
 
Windows Azure loves OSS
Windows Azure loves OSSWindows Azure loves OSS
Windows Azure loves OSS
Kazumi Hirose
 
Detecting headless browsers
Detecting headless browsersDetecting headless browsers
Detecting headless browsers
Sergey Shekyan
 
No Hugging, No Learning
No Hugging, No LearningNo Hugging, No Learning
No Hugging, No Learning
Olaf Alders
 
Introducing to node.js
Introducing to node.jsIntroducing to node.js
Introducing to node.js
JeongHun Byeon
 
The SPDY Protocol
The SPDY ProtocolThe SPDY Protocol
The SPDY Protocol
Fabian Lange
 
Node ppt
Node pptNode ppt
Let s Enjoy Node.js
Let s Enjoy Node.jsLet s Enjoy Node.js
Let s Enjoy Node.js
Fred 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 environment
bocribbz
 
CasperJS and PhantomJS for Automated Testing
CasperJS and PhantomJS for Automated TestingCasperJS and PhantomJS for Automated Testing
CasperJS and PhantomJS for Automated Testing
X-Team
 
Mojolicious lite
Mojolicious liteMojolicious lite
Mojolicious lite
andrefsantos
 
Node
NodeNode
Building websites with Node.ACS
Building websites with Node.ACSBuilding websites with Node.ACS
Building websites with Node.ACS
Ricardo Alcocer
 
Mangling
Mangling Mangling
Mangling
Olaf Alders
 

What's hot (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 to 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-28
Fré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-12
Frédéric Harper
 
Hybrid application development
Hybrid application developmentHybrid application development
Hybrid application development
Engin 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 world
Stefano 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 Interface
Steve Knodl
 
IoT on Raspberry Pi
IoT on Raspberry PiIoT on Raspberry Pi
IoT on Raspberry Pi
John Staveley
 
Øredev2013 - FirefoxOS - the platform HTML5 deserves
Øredev2013 - FirefoxOS - the platform HTML5 deservesØredev2013 - FirefoxOS - the platform HTML5 deserves
Øredev2013 - FirefoxOS - the platform HTML5 deserves
Christian Heilmann
 
Iphone Presentation for MuMe09
Iphone Presentation for MuMe09Iphone Presentation for MuMe09
Iphone Presentation for MuMe09
Gonzalo Parra
 
Better With Friends: Android+NFC+Arduino
Better With Friends: Android+NFC+ArduinoBetter With Friends: Android+NFC+Arduino
Better With Friends: Android+NFC+Arduino
Pearl 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 Networking
Istanbul 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 2013
Jon 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 2023
Peter 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-07
Frédéric Harper
 
Android Things in action
Android Things in actionAndroid Things in action
Android Things in action
Stefano Sanna
 
Swift hardware hacking @ try! Swift
Swift hardware hacking @ try! SwiftSwift hardware hacking @ try! Swift
Swift hardware hacking @ try! Swift
Sally Shepard
 

Similar to 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
 

Recently uploaded

GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Zilliz
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 

Recently uploaded (20)

GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 

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/

Editor's Notes

  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