• Save
Hacktime for adk
Upcoming SlideShare
Loading in...5
×
 

Hacktime for adk

on

  • 414 views

Describe about ADK and Arduino, How to use them.

Describe about ADK and Arduino, How to use them.

Statistics

Views

Total Views
414
Views on SlideShare
414
Embed Views
0

Actions

Likes
1
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Hacktime for adk Hacktime for adk Presentation Transcript

  • Hacktime for ADK SeongJae Park <sj38.park@gmail.com>
  • Great to meet you SeongJae Park <sj38.park@gmail.com> A member of GDG Suwon Newbie to Arduino Let's enjoy hacking
  • Just do it - 1:Let's hack Arduino Download and install IDE, Arduino 1.0 If Mac, install FTDI USB driver(Link)
  • Just do it - 1:How to hack Arduino Let's blink led on Arduino board
  • Just do it - 1:How to hack Arduino Let's blink led on breadboard
  • Just do it - 1:How to hack Arduino Let's blink led on breadboard
  • Just do it - 1:How to hack Arduino 5V Ground 300 Ohm LED Ground 300 Ohm 5V
  • Background & Concepts Android accessories
  • Background & Concepts Android accessories
  • Background & Concepts ● No standard protocol / API ● Only selected devices ● Only selected developers
  • ● Android Open Accessory(AOA) support ○ From 3.1, Back-ported to 2.3.4 ○ USB api ○ AOA protocol ○ ADK Background & Concepts
  • ● Android Open Accessory(AOA) support ○ Standard ○ Any developer can develop ○ Works on every AOA supporting Android device Background & Concepts
  • ● AOA 2.0 protocol & ADK 2012 ○ Announced from Google IO 2012 ○ Connection via Bluetooth ○ Audio output ○ HID accessory support ○ From JellyBean(4.1) Background & Concepts
  • AOA support structure overview AOA protocol USB api Application
  • AOA protocol Is in accessory mode? (show vendor id, product id) Support AOA? (GET_PROTOCOL) Start accessory mode (ACCESSORY_START) Establish connection Bad ending :'( YES NO YES NO
  • USB API App can communicate with USB devices ● Host mode ○ From 3.1 ● Accessory mode ○ Back ported to 2.3.4(Google APIs add-on library)
  • USB API ● Notify connected device using intent ● Can enumerates connected devices ● Request permission to user ● Can interact using I/O Stream like file
  • ADK - components ● Sample USB api using application(DemoKit) ● Sample sketch for ADK using AOA(demokit) ● AOA protocol implementation library ● Arduino-USB control library ● ADK H/W design
  • ADK - impl of AOA protocol AndroidAccessory class
  • ADK - impl of AOA protocol isConnected : start point
  • ADK - impl of AOA protocol Is in accessory mode?
  • ADK - impl of AOA protocol Do you support AOA?
  • ADK - impl of AOA protocol I am...; Start accessory mode.
  • Establish connection Find end points, set configuration 1
  • ADK - impl of AOA protocol End points usage
  • Sample sketch using ADK adkminihack
  • Sample sketch using ADK New AndroidAccessory
  • Sample sketch using ADK init and power on
  • Sample sketch using ADK Connect, listen, echo
  • Sample app using USB api ADKMiniHack
  • Sample app using USB api Feature, Library, Intent filter
  • Sample app using USB api accessory_filter.xml
  • Sample app using USB api ● "com.android.future.usb" for gingerbread ● "android.hardware.usb" for only 3.1 or upper
  • Sample app using USB api Get UsbManager and Enumerate accessories Request Permission
  • Sample app using USB api Open accessory
  • Sample app using USB api File-like interface
  • Sample app using USB api Listening, too.
  • Sample app using USB api Clean up when accessory detached.
  • Sample source codes ● Downloadable from github
  • Just do it - 2. Let's make simple AOA
  • Just do it - 2. Let's make simple AOA ADK Install ● Download ADK and extract
  • Just do it - 2. Let's make simple AOA ADK Install On Windows: 1. Copy the arduino_libs/AndroidAccessory and arduino_libs/USB_Host_Shield directories (the complete directories, not just the files within) to the <arduino_installation_root>/libraries/ directory.
  • Just do it - 2. Let's make simple AOA ADK Install On Mac: 1. Create, if it does not already exist, an Arduino directory inside your user account's Documents directory, and within that, a libraries directory. 2. Copy the arduino_libs/AndroidAccessory and arduino_libs/USB_Host_Shield directories (the complete directories, not just the files within) to your Documents/Arduino/libraries/ directory.
  • Just do it - 2. Let's make simple AOA ADK Install On Linux (Ubuntu): 1. Copy the firmware/arduino_libs/AndroidAccessory and firmware/arduino_libs/USB_Host_Shielddirectories (the complete directories, not just the files within) to the<arduino_installation_root>/libraries/ directory. 2. Install the avr-libc library by entering sudo apt-get install avr-libc from a shell prompt.
  • Just do it - 2. Let's make simple AOA To debug Arduino 1. Serial.begin(<baud-rate>) 2. Serial.println("This is debug message.")
  • Just do it - 2. Let's make simple AOA To debug Android device without USB 1. $ adb tcpip 5555 2. $ adb connect <device-ip>:5555 3. $ adb logcat 4. $ adb usb But, looks doesn't works well...
  • Just do it - 2. Let's make simple AOA ● For IP Confirm, ○ Wifi settings > Option menu > Advanced
  • Just do it - 2. Let's make simple AOA ● example code ○ example/ADKMiniHack ■ Change project build target to Google APIs 10 ○ example/Sketch
  • Just do it - 2. Let's make simple AOA ● OSCOKIRQ failed to assert ○ Problem occurs from ADK USB library's Max3421e. ○ Below is workaround for this from discussion
  • Let the hacking begin : Suggested misson ● Clavier that Input from phone screen, Output to Arduino ○ Turn on/off LED for each keys ○ Blink RGB led for each keys ○ Turn off when it's too dark(night) ○ Make tones higher with analog dialer
  • Let the hacking begin : Sample
  • This work by SeongJae Park is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. To view a copy of this license, visit http: //creativecommons.org/licenses/by-sa/3.0/.