Setup Arduino MEGA ADK & supplied libraries
I recently bought an arduino MEGA ADK, but I couldn't establish any communication to my handset. I used the following setup:
- Arduino MEGA ADK, hooked up to a PC via USB
- PC w/ Win7 x64
- Arduino 1.0 IDE
- Power supply 9V / 2Amps
- Google Nexus S w/ Android 4.0.3 ICS
I downloaded the Handbag App, but no way, no communication at all.
Solution was:
Download this file, which contains the AndroidAccessory and the USB_Host_shield libraries. Due to modifications in Arduino 1.0, you have to edit following files:
In the folder AndroidAccessory:
AndroidAccessory.h, Line 71: replace "void write(....." by "size_t write(...".
AndroidAccessory.cpp, Line 280: same here, replace "void" by "size_t"
In the folder USB_Host_Shield:
Max_LCD.h, Line 101: replace "virtual void write..." by "virtual size_t write..".
Max_LCD.cpp, Line 257: replace "inline void Max_LCD..." by "inline size_t Max_LCD..."
This is because the write function in Arduino 1.0 now returns the size of the array, therefore the void causes a conflict.
Now everything should work just fine. Enjoy!
Ken Foe Ken Foe Ken Foe Ken Foe