MicroBridge: ADB support for Arduino

May 15, 2011

Google recently announced their open accessory toolkit, a new way of making Android talk to microcontrollers over USB. Unfortunately there are currently two barriers that are preventing people from playing with it. One is a lack of hardware, which I addressed in my previous post. Another is a lack of devices that support the new USB protocol, requiring either Android 2.3.4 or 3.1.

Fortunately almost every Android device since 1.5 supports the Android Debug Bridge (ADB) protocol, which allows for some interesting functionality such as TCP forwarding between the phone and PC, shell access, logcat output, and so forth. This protocol can be easily exploited to do communication between an Android application and an Arduino with USB host support. MicroBridge and other projects such as PropBridge and IOIO implement ADB on microcontroller platforms, and have been shown to work with a wide range of devices. For those who want Android/Arduino connectivity but don’t have access to a phone that is capable of accessory mode, ADB is a good alternative.

MicroBridge uses an Arduino and a USB host shield. This is concidentally the exact same setup Google later chose for their ADK reference kit. Since it was first released back in February I got a lot of response from people asking if I would port it to the Wiring language so that it would be available in the Arduino IDE. My original implementation was in C because I personally prefer it over the C++/Wiring stuff that Arduino uses. With Google releasing ADK however I’ve seen a sharp increase in interest for MicroBridge as well, and with new exciting hardware coming out, such as this board from diyrones, I felt it was time to finally put in the effort and do a port.

disclaimer: this solution has been tested on Arduino Uno, but should also work on an Arduino Mega + Oleg’s 2.0 shield. It should also be trivial to make it work on Google’s ADK reference board and the new diydrones board. If you have access to such hardware and would like to test it for me, please let me know.

Here’s a quick video of MicroBridge in action:

The code is available here. Follow this guide for installation instructions. The library contains all the code for driving the max3421e USB host chip, so there are no dependencies on Oleg Mazurov’s library. My code is heavily based on his work however, so credits should go to Oleg for his hard work. In case you were wondering about the board in the video, it’s a DFRobot Romeo.

Programming

The library supports multiple streams and is event driven. You create connections to ADB streams and receive events when streams (re)connect, disconnect, or receive data. First you must initialise the library in the setup function of your sketch:

void setup()
{
  // Initialise the ADB subsystem.
  ADB::init();
}

In the loop method, you must continually poll the ADB layer, like so:

void loop()
{
  // Poll the ADB subsystem.
  ADB::poll();
}

These two calls are the minimum for establishing and maintaining a connection to your phone. Even without opening any streams you should see the debugging symbol show up in the notification bar of your phone.

Opening a connection is done with the addConnection method. This method creates a new Connection object and returns a reference to it. You will use this reference to issue writes. The first argument describes what you’re connect to. Examples are shell: to get a unix shell, shell:exec logcat for logcat output, and tcp:4567 to forward local TCP port to the Arduino. The second argument indicates whether the connection should auto-reopen. You can choose to either create a connection that is opened only once when the device is first connected, or one that automatically re-opens when it is closed. This can be used to create connections that are re-established when a device is unplugged and then plugged back in. The final argument is a callback method that serves as an event handler. If you don’t want to receive events or read from this stream you are allowed to pass NULL. For example:

// Open an ADB stream to the phone's shell. Auto-reconnect
shell = ADB::addConnection("shell:", true, adbEventHandler);

To receive data from the shell you must implement the event handler function. It takes three arguments, the Connection that is the source of the event, the payload length, and the payload data. Note that these last two are only relevant in the context of ADB_CONNECTION_RECEIVE events. Other possible events are ADB_CONNECTADB_DISCONNECTADB_CONNECTION_OPENADB_CONNECTION_CLOSE, and ADB_CONNECTION_FAILED. The first two indicate device connect/disconnect, the rest should be pretty self-explanatory.

// Event handler for the shell connection.
void adbEventHandler(Connection * connection, adb_eventType event, 
  uint16_t length, uint8_t * data)
{
  int i;

  if (event == ADB_CONNECTION_RECEIVE)
    for (i=0; i<length; i++)
      Serial.print(data[i]);

}

Finally, to write data to a connection, you can use the write and writeString methods.  For example, to reboot your phone:

if (shell->isOpen())
    shell->writeString("reboot\n");

Here’s a video of me rebooting my phone from an Arduino.

So how do we use ADB to get a two-way connection to the phone? The demo application seen in the video above the Android application listens on TCP a port, and the Arduino connects to it over ADB using TCP forwarding. This establishes a two-way byte pipe much like ADK provides. The source of the Android app is here.

Conclusion

The ADB protocol is certainly not perfect, but it can be a good alternative for hobbyists who don’t have access to devices with support for accessory mode. It also has some interesting features that ADK does not, such as rebooting your device, which enables the Arduino to watchdog the phone. ADB also supports multiple streams which is really nice since you don’t need to write a separate byte protocol to funnel multiple data streams over a single pipe. It also allows the Arduino to log data directly to SD card. Finally, I got a lot of use out of redirecting logcat output from the phone to the serial port, which meant that I didn’t have to debug in the dark when writing Android code.

ADB will not go away any time soon. According to the spec it should also be available in accessory mode which means you can use protocols at the same time. While the MicroBridge library does not support this yet, I will certainly add this if/once I get a compatible phone.

In the mean time, I’d love to hear your feedback, bug reports, test results, and so forth.

About these ads

54 Responses to “MicroBridge: ADB support for Arduino”


  1. VERY VERY VERY VERY VERY GOOD!!!!!
    My project will renovate:
    Pescolino who carry a phone can surf on a fixed route communicating with another Android phone via wifi.


  2. Last question:
    which pins are used for the library?
    Thanks a looooot!
    Rice

  3. RobotFreak Says:

    Hi,

    I’ve tested the DemoApp. It crashed immediately on my phone and on the emulator. I’m running Android v2.3.4 on a Nexus One.

    When I tried to compile the Arduino Sketches with DEBUG options I get several errors. I have fixed it by myself (SerialPrint funstion is missing).

    Thats it so far
    Greatings RobotFreak

    • romfont Says:

      Ah yes, the #debug stuff is still there from the C version, I should fix that, thanks.

      As for the DemoApp crashing, could you give me some logcat output?

      Did the other sketches (i.e. Shell) work for you?

      • RobotFreak Says:

        Here is the logcat output:
        05-17 20:50:01.086: ERROR/AndroidRuntime(334): FATAL EXCEPTION: main
        05-17 20:50:01.086: ERROR/AndroidRuntime(334): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.tudelft.microbridge/org.tudelft.microbridge.MicroBridge}: java.lang.ClassCastException: org.tudelft.microbridge.MicroBridge
        05-17 20:50:01.086: ERROR/AndroidRuntime(334): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
        05-17 20:50:01.086: ERROR/AndroidRuntime(334): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
        05-17 20:50:01.086: ERROR/AndroidRuntime(334): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
        05-17 20:50:01.086: ERROR/AndroidRuntime(334): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
        05-17 20:50:01.086: ERROR/AndroidRuntime(334): at android.os.Handler.dispatchMessage(Handler.java:99)
        05-17 20:50:01.086: ERROR/AndroidRuntime(334): at android.os.Looper.loop(Looper.java:123)
        05-17 20:50:01.086: ERROR/AndroidRuntime(334): at android.app.ActivityThread.main(ActivityThread.java:3683)
        05-17 20:50:01.086: ERROR/AndroidRuntime(334): at java.lang.reflect.Method.invokeNative(Native Method)
        05-17 20:50:01.086: ERROR/AndroidRuntime(334): at java.lang.reflect.Method.invoke(Method.java:507)
        05-17 20:50:01.086: ERROR/AndroidRuntime(334): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
        05-17 20:50:01.086: ERROR/AndroidRuntime(334): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
        05-17 20:50:01.086: ERROR/AndroidRuntime(334): at dalvik.system.NativeStart.main(Native Method)
        05-17 20:50:01.086: ERROR/AndroidRuntime(334): Caused by: java.lang.ClassCastException: org.tudelft.microbridge.MicroBridge
        05-17 20:50:01.086: ERROR/AndroidRuntime(334): at java.util.TreeMap.find(TreeMap.java:254)
        05-17 20:50:01.086: ERROR/AndroidRuntime(334): at java.util.TreeMap.putInternal(TreeMap.java:240)
        05-17 20:50:01.086: ERROR/AndroidRuntime(334): at java.util.TreeMap.put(TreeMap.java:186)
        05-17 20:50:01.086: ERROR/AndroidRuntime(334): at java.util.TreeSet.add(TreeSet.java:113)
        05-17 20:50:01.086: ERROR/AndroidRuntime(334): at org.tudelft.microbridge.server.Server.addListener(Server.java:112)
        05-17 20:50:01.086: ERROR/AndroidRuntime(334): at org.tudelft.microbridge.MicroBridge.(MicroBridge.java:31)
        05-17 20:50:01.086: ERROR/AndroidRuntime(334): at java.lang.Class.newInstanceImpl(Native Method)
        05-17 20:50:01.086: ERROR/AndroidRuntime(334): at java.lang.Class.newInstance(Class.java:1409)
        05-17 20:50:01.086: ERROR/AndroidRuntime(334): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
        05-17 20:50:01.086: ERROR/AndroidRuntime(334): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
        05-17 20:50:01.086: ERROR/AndroidRuntime(334): … 11 more

        The logcat sketch works.

        The shell Sketch gives a ‘Shell not open’ Error message.

    • romfont Says:

      Oh, the joys of Android programming …

      I think I’ve seen this problem before. What API level is the emulator you’re using? That way I can see if I can reproduce the problem. I believe it’s an issue with generics and type casting that’s a bit off on Dalvik.

      As for the shell, that should just work. In fact, it worked on every device I’ve tried it with so far (blade, hero, g1, galaxy s, etc.). I assume ‘adb shell’ from the command line works for you?

      • RobotFreak Says:

        I’m using API Level 10 for the emulator. Don’t realize that there are so many differences between different API levels.

        I will check later if ‘adb shell’ from command shell is working.

      • RobotFreak Says:

        ‘adb shell’ form command line works. The sketch works a little bit. I see a ‘$’ cursor and can put in some commands, but very often I get the ‘Shell not open’ error.

        I tried to compile the DemoApp with different API Levels (7,8) but it always crashes.

    • romfont Says:

      When you write a piece of data to an ADB connection it becomes blocked until the phone has acknowledged its reception. The connection object will be in the ‘ADB_WRITING’ state until it gets this ack. If you check Shell.pde you’ll see that the code checks for this state before it attempts to write the next byte. If the Connection is not ready it will print the ‘Shell not open’ error message.

      A solution would be to make the write method blocking and keep polling the USB bus for an acknowledgement (an ADB ‘OKAY’ message) before returning, but I haven’t figured out how to design that yet so that it works cleanly with multiple streams. Another would be to buffer the input from the terminal.

      Personally I’m a bit surprised that you’re getting this error since the USB transfer is usually an order of magnitude faster than I can type, so when I input the next character the connection is always in the open state.

      In any event, thanks for the feedback, I’ll look into it.

  4. parimal Says:

    hi, really nice work!!
    I want to send some data taken from arduino to android, i m able to send the data from arduino but dont know how to receive it in the android application, the application which i downloaded is for sending the scrollbar data to arduino, i could’nt find anything which receives the data
    thanks

    • romfont Says:

      I accidentally uploaded the wrong Android app. Please get ServoControl.zip from code.google.com/p/microbridge.

      • RobotFreak Says:

        Hi Inopia,

        great work! I’ve just downloaded and installed the servo app. It works like a charm :-). Thank you so much. Now I can use both, ADB and ADK.

        Greatings RobotFreak

  5. Mark Hester Says:

    This is exactly what I’ve been looking for since the announcement about Open Accessory. I have an android tablet that won’t be updated to 3.1 but really want to hook it up to an arduino using a USB host shield that I have. Problem is I have no experience of eclipse. Can anyone provide the demo android app as an apk file that I can load onto the tablet to test my setup?
    I’m planning to write my android app using Flash eventually (only because it’s what I know).
    Thanks in advance for any help.

  6. Han Says:

    hello , When I tried to compile the Arduino Sketches, I get several errors. Can anyone help me? I’m new in arduino programming.Thanks for any help.

  7. RobotFreak Says:

    Hello,
    just completed an early version of MicroBridge for .NETMF devices, called FezBridge. Im using a slightly modified version of your ServoControl app for testing. Hope, this is ok for you. Will write my own apps soon.
    Video can be found here:

    Source code is on Google code:
    http://code.google.com/p/robotfreak/wiki/FezBridge
    Thank you for sharing this wonderful project

    Greatings RobotFreak

  8. The_YongGrand Says:

    Thanks for the code.

    however, there is one issue: I stripped down the Java app into the bare essentials, and only left the area where the TCP Server should be started.

    Unfortunately, the logs kept on saying “Unable to start TCP server” on the emulator and on my Android (2.2) phone itself. What else should I check over there?

    Thanks.

  9. The_YongGrand Says:

    Dear romfont,

    Apologies for accidently posting another one, but I had to.

    By the way – is it possible if you can make a most stripped down code for an example, like just turning on one LED?

    I had been working on it for a whole Sunday but there is no luck. Perhaps my Java isn’t too good, or something else.

    Thanks.

  10. ThrS Says:

    Hello

    I’m desperate. I can not run the libraries of Microbridge.
    I have an Arduino Shield Mega2560 + USB Shield 2.0 Host Circuits @ Home. The sample library provides Olaf to test the shield, works well.
    But using these libraries and call ADB: Init. An error occurs: “Error: failed to assert OSCOKIRQ. ”

    I tested several things, but I can not work. How I can fix it?

    Thanks.

    • ThrS Says:

      Fixed.
      In “max3421e.h”, line 68: “# define MAX_SS (x) digitalWrite (SS, x). ”
      Where it says “SS”, I had to change to “PIN_MAX_SS. ”

      The “SS ” Pin “Arduino MEga2560″ for SPI communication is different from the value PIN_MAX_SS.

      Changing that. The library “microbridge” works perfectly.

      • romfont Says:

        Thanks a lot for the bug report and fix! I’ll check it into the SVN asap.

      • Joey Says:

        Hello: I have met the same error message, “Error: OSCOKIRQ failed to assert”, and I’ve tried to change the line

        “#define MAX_SS(x) digitalWrite(SS, x)”
        to
        “#define MAX_SS(x) digitalWrite(PIN_MAX_SS, x)”,

        but I get the same error, any ideas ?

  11. viswesr Says:

    Hi Inopia,

    Microbridge works very well with ADK Board with small change :

    Just initialize the SS,INT,GPS and RESET pins in max3421e_init() as :

    pinMode(PIN_MAX_SS, OUTPUT);
    DDRE &= ~ 0×40; // MAX_INT as input
    DDRJ &= ~ 0×08; //MAX_GPX as input
    DDRJ |= 0×04; //MAX_RESET as output

    apart from using the following defines in max3421e.h file

    #ifdef ADK_REF_BOARD

    #define PIN_MAX_SS 53

    #define MAX_SS(x) digitalWrite(SS, x)
    #define MAX_INT() ((PORTE & 0×40) >> 6)
    #define MAX_GPX() ((PORTJ & 0×08) >> 3)
    #define MAX_RESET(x) { if (x) PORTJ |= 0×04; else PORTJ &= ~0×04; }

    #endif

    I tested this with Seeeduino ADK. Thanks. Very useful library.

  12. Gee Says:

    Thanks inopia ,,it’s work fine.

  13. fr4gus Says:

    Greetings from Costa Rica, I followed both posts, and I was able to make it work on my SonyEricsson Xperia X10, Arduino Uno + Sparkfun USB Host Shield 2.0. Obviously I couldn’t try Google’s app, but I ran ADB samples without issues.

  14. Ajith Says:

    Thanks for the wonderful post, I have a Samsung Galaxy S updated to 2.3.4 but still doesn’t support ADK. This is the best approach for me to interface to an Arduino. I’m developing an app for the arduino but would like to do my Android app testing on the PC. I want to be sure that the Android app is actually sending the right bytes, so is there a way I can read and write to the Microbridge from a Linux app?

  15. ttyusbn Says:

    I have ServoControl app running on Android phone, connected to PC through USB. Now I want to test the application (send to/ receive from) some data using adb.exe.
    When I try adb connect 4567 I get the message that it’s unable to connect.
    What commands should I use?

  16. ThiruSS Says:

    Hi.
    To adapt their MicroBridge library for use with a Mega Arduino ADK. You need to change:
    In “void max3421e_init ()”: “pinMode (PIN_MAX_RESET, OUTPUT);” to “DDRJ | = _BV (PJ2),” with just that small change, your library is working correctly as using an Arduino Mega with Oleg’s USB host shield.
    So with:

    max3421e_init void ()
    {

    SPI.begin ();
    pinMode (PIN_MAX_GPX, INPUT);
    pinMode (PIN_MAX_SS, OUTPUT);
    DDRJ | = _BV (PJ2)

    / / SPI Pull! SS high
    MAX_SS (1);
    / / Reset
    MAX_RESET (1);

    }

    works

  17. enal Says:

    Hi, trying to get a USB Host Shield that works with the Romeo – I think there is some non standard pin config. Which one are you using in the vid, please? Any caveats one should know about..? :-)

    Thanks a lot!

  18. romfont Says:

    Hi. The direction pin of the second motor driver overlaps with the USB host shield’s reset pin. So basically it works, but one of the motors can only turn one way :)

  19. enal Says:

    Hey Romfort -

    But which USB Host shield are you actually using? The Circuits@Home one? DFRobot also have a USB host shield. I wonder if that works… Maybe not, since they don’t respond to my inquiry :-)

    Regarding that pin – can’t you just clip it and re-route with a wire?

    Cheers!

  20. tetsujin28 Says:

    Hi,
    I tried the example using sparkfun usb host shield, device is HTC Desire HD
    logcat example worked, but shell example didn’t work, error message is “shell not open”

  21. phil Says:

    Hi, awesome work, I’ve got this working great using arduino demilanove and sparkfun USB host shield, but would really like to get it working on oleg’s board so i can use the mini boards.

    Testing both the full size shield from oleg with a demilanove, and the mini with an arduino pro mini 3.3v, i am getting “OSCOKIRQ failed to assert”

    I have tried to make the change referenced above to change to #define MAX_SS(x) digitalWrite(PIN_MAX_SS, x) (although i think this is probably just for a mega board?). Either way, cant get any of olegs boards to work (no disrepect oleg, i still think you are the man!).

    Please could somebody help me.

    Thanks in advance

    phil

  22. enal Says:

    Hi guys – I am momentarily at my wits end…

    I have an DFRobot Romeo and Oleg’s shield hooked up to a phone running Cyanogenmod 7.1. The MicroBridge Getting Started is running fine – I can control 2 Servos on default pins 2/3 with the joystick on the touch screen.

    However, when changing the pin assignments to for example (11/12) or anything else, things break down. Doing a reset without the phone connected twitches the servo around a couple of times. Once the phone gets plugged in the Servo gets pulled into a maximum position and doesn’t respond to the joystick.

    I am under the impression that the Android code is neutral regarding pins (as it should be) and assignment is done exclusively in Arduino code. I have also been digging through the libraries to make sense of it, but without success.

    Reading max3421e.cpp in Adb I find the comment: * Note that the current incarnation of this library only supports the Arduino Mega with a hardware mod to rewire the MISO, MOSI, and CLK SPI pins.
    Unfortunately I have no idea how to fix it for a different Arduino, such as my DFRobot Romeo.

    Can anyone give a hint please? Thanks.

    • phil Says:

      i had the same problem but found i could only use pins 1 to 5 i think it was for ppm, the higher numbers are used for the board. This was the case with the sparkfun shield anyway. I couldn’t get it to work with oleg’s board.

      I would really appreciate to know how you got it to work with olegs boards as i’d love to use the mini version. phil_cleaver@hotmail.com.

      • enal Says:

        Nothing special, really. Just wire it up and plug it in. Both Oleg’s QA test and the ADB Getting Started work. Independently the pins also work when not using USB libs.

        I don’t think (or cannot find where) other pins are assigned. In fact, I can run Oleg’s board just with the ICSP header, Reset, GND, 5V, 3.3V as well as pins 9 and 10 connected to the Arduino. Do you know where/why other pins might be utilized?

        Also, on the Romeo board pins 4-7 are sort of reserved for the motor driver. I have a much better handle on the Android side of things and don’t quite follow the Arduino library / hardware code yet. I also see the Romeo being used in inopiaaardbe YouTube video above and was really hoping to get some help.

  23. enal Says:

    @phil (looks like we maxed out reply buttons on the thread…)

    DFRobot Romeo + Oleg’s USB Shield v 2.0 (see above)

    • enal Says:

      As a follow up – I didn’t feel like investing a ton of time into fixing USB shield. I am sure Oleg’s board is fine for some stuff but there seem to be severe flaws as well. I am no expert but why does it need all these pins instead of using the header? Based on what I see online people are somehow intimidated and there isn’t much support or even answers that help to help oneself. Whatever…

      So to be able to invest my time into what I actually care about I went ahead and got a SparkFun IOIO board. It worked out of the box and really is a really great device. My advice would be to spend a few bucks more and go with that instead of the USB shields.

      • bilbo Says:

        There does seem to be a lack of documentation on how to get this going with different types of hardware. Some more information on how to adapt the Arduino code to do something else than 2 pwm outputs and one analogue in would be appreciated too.

  24. phil Says:

    Arduino Mega ADK and Microbridge.

    Hi I have a Mega ADK for Android, the official one, not the seeduino one. I’m using Arduino 0022, but have tried 0023 and Beta 1.0 and beta 1.0 r2. I have made all the suggested changes in max 3241e.h and max 3241e.cpp. I have updated the boards.txt files that we are told to use for the Mega ADK board. I am compiling it as Mega ADK. I have changed all the dodgy versions of the character x repasted from the web.

    I have tested on Android 2.1, 2.2, 2.3.2, and 3.1.
    Still, everthing I do I get Error: OSCOKIRQ failed to assert
    (does anyone know what this actually means??????).

    The only way I have got this awesome library to work is with Sparkfun shields and demuilanove or uno.

    Has anyone got the standard mega ADK or oleg mini shields working?

    Thanks in advance

    • ThiruSS Says:

      Phil
      Check my previous messages. I already work with this library with an Arduino Mega + Oleg Shield and the new Arduino ADK.
      It works perfectly with both.

      • phil Says:

        Thanks for prompt answer ThiruSS, I’m sure I’ve tried everything. Just to confirm was the board you tested the official Arduino Mega ADK or the Seeeduino ADK.
        Which version of Arduino compiler? 0022?
        Standard Microbridge libraries as on the google code website?
        Compiled as which board, Mega or Mega ADK or something else.
        No hardware mods?
        Powering the Mega ADK board using the power connector, if so what voltage and amperage, or usb? only asking as i know lack of adequate power can give OSCOKIRQ error message.

        I’ve spent days trying to get anything other than spakfun shield working. All comments greatly appreciated. I’ll even send you some $$$ if you like as I really really need this going.

        Any chance of emailing the config files? phil_cleaver at hotmail.com.

        Many many thanks.

        Phil

      • phil Says:

        ThiruSS,

        I’m trying again, you said previously to just change

        “pinMode (PIN_MAX_RESET, OUTPUT);” to “DDRJ | = _BV (PJ2),”

        which by my reckoning gives me….

        void max3421e_init()
        {

        SPI.begin();

        pinMode(PIN_MAX_INT, INPUT);
        pinMode(PIN_MAX_GPX, INPUT);
        pinMode(PIN_MAX_SS, OUTPUT);
        DDRJ | = _BV (PJ2),

        MAX_SS(1);
        MAX_RESET(1);
        }

        but you say it gives you this…….

        max3421e_init void ()
        {

        SPI.begin ();
        pinMode (PIN_MAX_GPX, INPUT);
        pinMode (PIN_MAX_SS, OUTPUT);
        DDRJ | = _BV (PJ2)

        / / SPI Pull! SS high
        MAX_SS (1);
        / / Reset
        MAX_RESET (1);

        }

        not being picky, really appreciate your help but there’s a few discrepencies.

        is it
        void max3421e_init()
        or is it
        max3421e_init void ()

        does
        pinMode(PIN_MAX_INT, INPUT);
        go in or not?

        should
        DDRJ | = _BV (PJ2)
        have a space between the | and the =
        also should it have a comma after it???? or nothing at all??? or a semicolon would seem to make more sense.

        Thanks again

        Phil

  25. ThiruSS Says:

    A query to read the log of Android through Arduino, using:
    “logcat = ADB:: AddConnection (” shell: exec logcat “, false, logHandler);”

    It works perfect. But how I can filter the log messages you receive, to receive only the Warning of a particular application? Anybody can help me? Thanks

  26. enal Says:

    I think MicroBridge is fine and I am thankful for romfront’s lib. The trouble is more on the hardware side. I am working on a complex project that has enough challenges in software and just don’t have the time to figure out related hardware issues. I would send the comments Lance made to Oleg – after all Oleg is charging hard cash. Granted, there is physical hardware which has a cost, but according to my testing there are various valuable pins taken over by USB host shield rendering it fairly useless in my case and he won’t fess up what is going on…

  27. Nanda Says:

    i mean #include
    or
    #include “string.h”

  28. John Says:

    Raising Capital?
    Find out if your company is VentureWorthy – for free.
    Angel investors and VC investors want to learn more about your startup.
    http://www.ventureworthy.com


  29. Hi all,
    found this bunch of MicroBridge tutorials today. Great stuff for beginners.
    http://mitchtech.net/category/tutorials/adb-tutorials/

    Greatings RobotFreak


  30. Thanks for this beautiful tutorial. I have developed to this point. Now I want to control the same from my PC i.e the arduino + android to be controlled from the PC. How this can be done? This will enable to built a remote controlled robot


  31. Grt tutorial :) I have a PING Sensor,mega adk,and 2.3.4 phone..i tried ur tutorial..the firmware ran.the apk also ran..but i didnt connect any servos thts why maybe nthin was happening..i want to connect PING sensor to board and get its values to my android.wht changes i need to make in order to do tht in the firmware n the apk?? u told to connect the sensor in A0 pin.hw can i connect the PING with A0 pin?? plz help.i badly need ur help :(


  32. thank you for this great work
    i have Arduino mega adk for android original
    and its work with android Accessory library
    while iam using adb library i found it so easy
    but the problem i faced its Error: OSCOKIRQ failed to assert
    and i did all solution in this tutorial but no one give me right solution
    please can any one give me the perfect hint or solution to work it !!


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: