Here is how I used the same board and to get started with ADK.
Aim:
Use the official DemoKit app from google and control a LEDRequirements
Hardware Requirements:
- Android Phone (Android version 2.3.4 or above. I used Google Nexus 4)
- LED
- Resistor
- Freeduino-Mega-2560-ADK
- Connecting Wires
Software Requirements:
- Arduino IDE (I used version 1.0.2)
- USB Host Shield Library 2.0
- Eclipse IDE (I used Version: Indigo Release Build id: 20110615-0604)
- Android SDK
- Demo Android App
Prerequisites:
There are enough resources to successfully install and configure Eclipse IDE and Android SDK. Similarly there are enough resources about installing Arduino IDE.So I am not covering it.
Try using the blink example in Arduino to ensure that the Freeduino-Mega-2560-ADK is in working condition.
Preparing the Arduino Board:
Installing the USB_Host_Shield_2.0 is merely unzipping it in the "libraries" directory of arduino.(NOTE: I got an error saying that arduino doesnt support "." in library name. So I had to rename the directory from USB_Host_Shield_2.0 to USB_Host_Shield_2_0)
Open avrpins.h and uncomment the line.
#define BOARD_MEGA_ADK Open Arduino IDE. (a restart of the IDE might be required to detect the new library)
Upload example demokit_20 sketch (File -> Examples -> USB_Host_Shield_2_0 -> adk -> demokit_20) .
Connect a resistor and LED in series between PIN 3 and GND.
Installing the Demo Android App:
- Unzip the contents of adk_release_0512.zip
- Import the project into Eclipse. (File -> Import -> Anrdroid -> Existing Code Into Workspace)
- Right click on the project . Properties -> Android . Change the target from Anrdoid 2.3.3 to Google API 2.3.3.
- Connect the phone to the PC. and Install the app on the phone (Run -> Run As -> Android App). Choose the Phone in "Android Device Chooser".