SlideShare a Scribd company logo
1 of 25
Arduino
Android
Arduino vs Android
• Via USB interface
Arduino vs Android
• Via Bluetooth
Arduino vs Android
• Via Wifi
• eclipse with android sdk
• http://developer.android.com/sdk/index.html

• Arduino
• http://arduino.cc/en/main/software
API
• Microbridge
       – Android Debug Bridge (ADB) implementation for microcontrollers.


• Download
       – http://code.google.com/p/microbridge/
ADB
• supports opening a shell on the phone

• pushing files to the phone

• reading debugging logs

• forwarding TCP ports and Unix sockets.
Hardware
• Support
  – Uno
  – Deicimila
  – Mega
  – compatible


• Example
  – http://code.google.com/p/microbridge/downloads/list
Android project
Android project
Download Servo Example
Android project
Copy org from servoControl/src/
Android project
Android project
Arduino
Download Microbridge
Arduino
Copy Adb in Microbridge to Arduino/libraries
Arduino
Copy Adb in Microbridge to Arduino/libraries
Arduino
Android Example
• Start Server
      Server server = null;
      try

      server = new Server(4567);
      server.start();
      } catch (IOException e)

      Log.e("microbridge", "Unable to start TCP server", e);
      System.exit(-1);
Android Example
• Server listener                                                    android
      this.server.addListener(new AbstractServerListener() {

       @Override
       public void onReceive(org.microbridge.server.Client client,
      byte[] data)


        if (data.length<2) return;
         sensorValue = (data[0] & 0xff) | ((data[1] & 0xff) << 8);
        postInvalidate();
Android Example
• Server send

      try

      server.send(new byte[] { (byte)x, (byte)y });
      } catch (IOException e)

      Log.e("microbridge", "problem sending TCP message", e);
Arduino Example
innital

   ADB::init();

Add connection
   connection = ADB::addConnection("tcp:4567",
  true, adbEventHandler);

Poll
  ADB::poll();
Arduino Example
EventHandler
                        controller
 void adbEventHandler(Connection * connection,
 adb_eventType event, uint16_t length, uint8_t * data)
 {
   int i;

  // Data packets contain two bytes, one for each servo, in
 the range of [0..180]
  if (event == ADB_CONNECTION_RECEIVE)
  {
    servos[0].write(data[0]);
    servos[1].write(data[1]);
  }

 }
Arduino Example
Send to Android                   android


   connection->write(2,(uint8_t*)&data);



              2 Byte
Question
Source
• http://code.google.com/p/microbridge/
• http://developer.android.com/tools/help/adb.
  html
• http://developer.android.com/sdk/index.html
• http://arduino.cc/en/main/software

More Related Content

What's hot

Collect distributed application logging using fluentd (EFK stack)
Collect distributed application logging using fluentd (EFK stack)Collect distributed application logging using fluentd (EFK stack)
Collect distributed application logging using fluentd (EFK stack)Marco Pas
 
Altitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, Ever
Altitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, EverAltitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, Ever
Altitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, EverFastly
 
Spark Day 2017- Spark 의 과거, 현재, 미래
Spark Day 2017- Spark 의 과거, 현재, 미래Spark Day 2017- Spark 의 과거, 현재, 미래
Spark Day 2017- Spark 의 과거, 현재, 미래Moon Soo Lee
 
Altitude NY 2018: Programming the edge workshop
Altitude NY 2018: Programming the edge workshopAltitude NY 2018: Programming the edge workshop
Altitude NY 2018: Programming the edge workshopFastly
 
jimmy hacking (at) Microsoft
jimmy hacking (at) Microsoftjimmy hacking (at) Microsoft
jimmy hacking (at) MicrosoftJimmy Schementi
 
Whats New in ASP.NET Core
Whats New in ASP.NET CoreWhats New in ASP.NET Core
Whats New in ASP.NET CoreJon Galloway
 
node.js and native code extensions by example
node.js and native code extensions by examplenode.js and native code extensions by example
node.js and native code extensions by examplePhilipp Fehre
 
Virtual training Intro to Kapacitor
Virtual training  Intro to Kapacitor Virtual training  Intro to Kapacitor
Virtual training Intro to Kapacitor InfluxData
 
用 Go 語言打造多台機器 Scale 架構
用 Go 語言打造多台機器 Scale 架構用 Go 語言打造多台機器 Scale 架構
用 Go 語言打造多台機器 Scale 架構Bo-Yi Wu
 
Creating basic workflows as Jupyter Notebooks to use Cytoscape programmatically.
Creating basic workflows as Jupyter Notebooks to use Cytoscape programmatically.Creating basic workflows as Jupyter Notebooks to use Cytoscape programmatically.
Creating basic workflows as Jupyter Notebooks to use Cytoscape programmatically.Hakky St
 
Job Queue in Golang
Job Queue in GolangJob Queue in Golang
Job Queue in GolangBo-Yi Wu
 
Debugging JavaScript with Chrome
Debugging JavaScript with ChromeDebugging JavaScript with Chrome
Debugging JavaScript with ChromeIgor Zalutsky
 
Xilinx ISE introduction Tutorial #1
Xilinx ISE introduction Tutorial #1Xilinx ISE introduction Tutorial #1
Xilinx ISE introduction Tutorial #1guest1e88645e
 

What's hot (13)

Collect distributed application logging using fluentd (EFK stack)
Collect distributed application logging using fluentd (EFK stack)Collect distributed application logging using fluentd (EFK stack)
Collect distributed application logging using fluentd (EFK stack)
 
Altitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, Ever
Altitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, EverAltitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, Ever
Altitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, Ever
 
Spark Day 2017- Spark 의 과거, 현재, 미래
Spark Day 2017- Spark 의 과거, 현재, 미래Spark Day 2017- Spark 의 과거, 현재, 미래
Spark Day 2017- Spark 의 과거, 현재, 미래
 
Altitude NY 2018: Programming the edge workshop
Altitude NY 2018: Programming the edge workshopAltitude NY 2018: Programming the edge workshop
Altitude NY 2018: Programming the edge workshop
 
jimmy hacking (at) Microsoft
jimmy hacking (at) Microsoftjimmy hacking (at) Microsoft
jimmy hacking (at) Microsoft
 
Whats New in ASP.NET Core
Whats New in ASP.NET CoreWhats New in ASP.NET Core
Whats New in ASP.NET Core
 
node.js and native code extensions by example
node.js and native code extensions by examplenode.js and native code extensions by example
node.js and native code extensions by example
 
Virtual training Intro to Kapacitor
Virtual training  Intro to Kapacitor Virtual training  Intro to Kapacitor
Virtual training Intro to Kapacitor
 
用 Go 語言打造多台機器 Scale 架構
用 Go 語言打造多台機器 Scale 架構用 Go 語言打造多台機器 Scale 架構
用 Go 語言打造多台機器 Scale 架構
 
Creating basic workflows as Jupyter Notebooks to use Cytoscape programmatically.
Creating basic workflows as Jupyter Notebooks to use Cytoscape programmatically.Creating basic workflows as Jupyter Notebooks to use Cytoscape programmatically.
Creating basic workflows as Jupyter Notebooks to use Cytoscape programmatically.
 
Job Queue in Golang
Job Queue in GolangJob Queue in Golang
Job Queue in Golang
 
Debugging JavaScript with Chrome
Debugging JavaScript with ChromeDebugging JavaScript with Chrome
Debugging JavaScript with Chrome
 
Xilinx ISE introduction Tutorial #1
Xilinx ISE introduction Tutorial #1Xilinx ISE introduction Tutorial #1
Xilinx ISE introduction Tutorial #1
 

Viewers also liked

u.cs101 "Алгоритм ба програмчлал" Лекц №5
u.cs101 "Алгоритм ба програмчлал" Лекц №5u.cs101 "Алгоритм ба програмчлал" Лекц №5
u.cs101 "Алгоритм ба програмчлал" Лекц №5Khuder Altangerel
 
u.cs101 "Алгоритм ба програмчлал" Лекц №3
u.cs101 "Алгоритм ба програмчлал" Лекц №3u.cs101 "Алгоритм ба програмчлал" Лекц №3
u.cs101 "Алгоритм ба програмчлал" Лекц №3Khuder Altangerel
 
u.cs101 "Алгоритм ба програмчлал" Лекц №4
u.cs101 "Алгоритм ба програмчлал" Лекц №4u.cs101 "Алгоритм ба програмчлал" Лекц №4
u.cs101 "Алгоритм ба програмчлал" Лекц №4Khuder Altangerel
 
u.cs101 "Алгоритм ба програмчлал" Лекц №1
u.cs101 "Алгоритм ба програмчлал" Лекц №1u.cs101 "Алгоритм ба програмчлал" Лекц №1
u.cs101 "Алгоритм ба програмчлал" Лекц №1Khuder Altangerel
 
Марковын далд загвар
Марковын далд загварМарковын далд загвар
Марковын далд загварKhuder Altangerel
 
Capitulo 11 reglamento
Capitulo 11 reglamentoCapitulo 11 reglamento
Capitulo 11 reglamentoJeral Arias
 

Viewers also liked (18)

Lec13 cachetlb
Lec13 cachetlbLec13 cachetlb
Lec13 cachetlb
 
Pdhpe
PdhpePdhpe
Pdhpe
 
Broadband Industry Group (for Rotary)
Broadband Industry Group (for Rotary)Broadband Industry Group (for Rotary)
Broadband Industry Group (for Rotary)
 
La ropa
La ropaLa ropa
La ropa
 
Pdhpe
PdhpePdhpe
Pdhpe
 
Lec14 demandpage
Lec14 demandpageLec14 demandpage
Lec14 demandpage
 
Lec09 deadlock
Lec09 deadlockLec09 deadlock
Lec09 deadlock
 
u.cs101 "Алгоритм ба програмчлал" Лекц №5
u.cs101 "Алгоритм ба програмчлал" Лекц №5u.cs101 "Алгоритм ба програмчлал" Лекц №5
u.cs101 "Алгоритм ба програмчлал" Лекц №5
 
Lec10 scheduling
Lec10 schedulingLec10 scheduling
Lec10 scheduling
 
Lec05 cooperating (1)
Lec05 cooperating (1)Lec05 cooperating (1)
Lec05 cooperating (1)
 
Lec03 concurrency (2)
Lec03 concurrency (2)Lec03 concurrency (2)
Lec03 concurrency (2)
 
u.cs101 "Алгоритм ба програмчлал" Лекц №3
u.cs101 "Алгоритм ба програмчлал" Лекц №3u.cs101 "Алгоритм ба програмчлал" Лекц №3
u.cs101 "Алгоритм ба програмчлал" Лекц №3
 
Lec07 exclusion
Lec07 exclusionLec07 exclusion
Lec07 exclusion
 
u.cs101 "Алгоритм ба програмчлал" Лекц №4
u.cs101 "Алгоритм ба програмчлал" Лекц №4u.cs101 "Алгоритм ба програмчлал" Лекц №4
u.cs101 "Алгоритм ба програмчлал" Лекц №4
 
u.cs101 "Алгоритм ба програмчлал" Лекц №1
u.cs101 "Алгоритм ба програмчлал" Лекц №1u.cs101 "Алгоритм ба програмчлал" Лекц №1
u.cs101 "Алгоритм ба програмчлал" Лекц №1
 
Марковын далд загвар
Марковын далд загварМарковын далд загвар
Марковын далд загвар
 
Capitulo 11 reglamento
Capitulo 11 reglamentoCapitulo 11 reglamento
Capitulo 11 reglamento
 
Capitulo 1
Capitulo 1Capitulo 1
Capitulo 1
 

Similar to ควบคุมบอร์ดArduinoผ่านระบบandroid

How to write clean & testable code without losing your mind
How to write clean & testable code without losing your mindHow to write clean & testable code without losing your mind
How to write clean & testable code without losing your mindAndreas Czakaj
 
Arduino and the real time web
Arduino and the real time webArduino and the real time web
Arduino and the real time webAndrew Fisher
 
Android Workshop
Android WorkshopAndroid Workshop
Android WorkshopJunda Ong
 
Automated malware analysis
Automated malware analysisAutomated malware analysis
Automated malware analysisIbrahim Baliç
 
04 android
04 android04 android
04 androidguru472
 
Arduino C maXbox web of things slide show
Arduino C maXbox web of things slide showArduino C maXbox web of things slide show
Arduino C maXbox web of things slide showMax Kleiner
 
Introduce about Nodejs - duyetdev.com
Introduce about Nodejs - duyetdev.comIntroduce about Nodejs - duyetdev.com
Introduce about Nodejs - duyetdev.comVan-Duyet Le
 
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres..."The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...Edge AI and Vision Alliance
 
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivityIoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivitySamsung Open Source Group
 
IoT: From Arduino MicroControllers to Tizen Products Using IoTivity - Philipp...
IoT: From Arduino MicroControllers to Tizen Products Using IoTivity - Philipp...IoT: From Arduino MicroControllers to Tizen Products Using IoTivity - Philipp...
IoT: From Arduino MicroControllers to Tizen Products Using IoTivity - Philipp...WithTheBest
 
Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Codemotion
 
Codetainer: a Docker-based browser code 'sandbox'
Codetainer: a Docker-based browser code 'sandbox'Codetainer: a Docker-based browser code 'sandbox'
Codetainer: a Docker-based browser code 'sandbox'Jen Andre
 
JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?Doug Hawkins
 
UA Mobile 2012 (English)
UA Mobile 2012 (English)UA Mobile 2012 (English)
UA Mobile 2012 (English)dmalykhanov
 
Building production-quality apps with Node.js
Building production-quality apps with Node.jsBuilding production-quality apps with Node.js
Building production-quality apps with Node.jsmattpardee
 
Kandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalKandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalNAVER D2
 
Networks lab
Networks labNetworks lab
Networks labsvijiiii
 
Networks lab
Networks labNetworks lab
Networks labsvijiiii
 

Similar to ควบคุมบอร์ดArduinoผ่านระบบandroid (20)

Node azure
Node azureNode azure
Node azure
 
How to write clean & testable code without losing your mind
How to write clean & testable code without losing your mindHow to write clean & testable code without losing your mind
How to write clean & testable code without losing your mind
 
Arduino and the real time web
Arduino and the real time webArduino and the real time web
Arduino and the real time web
 
Android Workshop
Android WorkshopAndroid Workshop
Android Workshop
 
Automated malware analysis
Automated malware analysisAutomated malware analysis
Automated malware analysis
 
04 android
04 android04 android
04 android
 
Arduino C maXbox web of things slide show
Arduino C maXbox web of things slide showArduino C maXbox web of things slide show
Arduino C maXbox web of things slide show
 
Introduce about Nodejs - duyetdev.com
Introduce about Nodejs - duyetdev.comIntroduce about Nodejs - duyetdev.com
Introduce about Nodejs - duyetdev.com
 
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres..."The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
 
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivityIoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
 
IoT: From Arduino MicroControllers to Tizen Products Using IoTivity - Philipp...
IoT: From Arduino MicroControllers to Tizen Products Using IoTivity - Philipp...IoT: From Arduino MicroControllers to Tizen Products Using IoTivity - Philipp...
IoT: From Arduino MicroControllers to Tizen Products Using IoTivity - Philipp...
 
Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!
 
Codetainer: a Docker-based browser code 'sandbox'
Codetainer: a Docker-based browser code 'sandbox'Codetainer: a Docker-based browser code 'sandbox'
Codetainer: a Docker-based browser code 'sandbox'
 
JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?
 
UA Mobile 2012 (English)
UA Mobile 2012 (English)UA Mobile 2012 (English)
UA Mobile 2012 (English)
 
ql.io at NodePDX
ql.io at NodePDXql.io at NodePDX
ql.io at NodePDX
 
Building production-quality apps with Node.js
Building production-quality apps with Node.jsBuilding production-quality apps with Node.js
Building production-quality apps with Node.js
 
Kandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalKandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_final
 
Networks lab
Networks labNetworks lab
Networks lab
 
Networks lab
Networks labNetworks lab
Networks lab
 

ควบคุมบอร์ดArduinoผ่านระบบandroid