Arduino Mega 2560 ADK

I tried to compile a simple program of blinking LED in Arduino Mega ADK and it threw me a lots of errors:

In file included from sketch_feb14a.cpp:1:
F:\Arduino\arduino-1.0\libraries\USB_Host_Shield/Max3421e.h:37:22: error: WProgram.h: No such file or directory
In file included from sketch_feb14a.cpp:1:
F:\Arduino\arduino-1.0\libraries\USB_Host_Shield/Max3421e.h:44: error: ‘byte’ does not name a type
F:\Arduino\arduino-1.0\libraries\USB_Host_Shield/Max3421e.h:47: error: expected ‘;’ before ‘(’ token
F:\Arduino\arduino-1.0\libraries\USB_Host_Shield/Max3421e.h:48: error: ‘byte’ has not been declared
F:\Arduino\arduino-1.0\libraries\USB_Host_Shield/Max3421e.h:49: error: ‘byte’ does not name a type
F:\Arduino\arduino-1.0\libraries\USB_Host_Shield/Max3421e.h: In static member function ‘static void MAX3421E::spi_init()’:
F:\Arduino\arduino-1.0\libraries\USB_Host_Shield/Max3421e.h:68: error: ‘pinMode’ was not declared in this scope
F:\Arduino\arduino-1.0\libraries\USB_Host_Shield/Usb.h:165: error: ‘byte’ does not name a type
F:\Arduino\arduino-1.0\libraries\USB_Host_Shield/Usb.h:169: error: ‘byte’ does not name a type
F:\Arduino\arduino-1.0\libraries\USB_Host_Shield/Usb.h:198: error: ‘byte’ does not name a type
F:\Arduino\arduino-1.0\libraries\USB_Host_Shield/Usb.h:201: error: ‘byte’ does not name a type

The program I was writing is
#include <Max3421e.h>
#include <Usb.h>
#include <AndroidAccessory.h>
#define LED_PIN 13
AndroidAccessory acc(“Manufacturer”,“Model”,“Description”,“1.0”,
http://yoursite.com”, “0000000012345678”);
void setup()
{
// set communiation speed
Serial.begin(115200);
pinMode(LED_PIN, OUTPUT);
acc.powerOn();
}
void loop()
{
byte msg[0];
if (acc.isConnected()) {
int len = acc.read(msg, sizeof(msg), 1); // read data into msg variable
if (len > 0) {
if (msg[0] == 1) // compare received data
digitalWrite(LED_PIN,HIGH); // turn on light
else
digitalWrite(LED_PIN,LOW); // turn off light
}
}
else
digitalWrite(LED_PIN , LOW); // turn off light
}

PLease help

Do anybody have a working sample program of Arduino ADK using the ADK and not ADB as used in Microbridge.

If possible give the corresponding Android App program also.

I want a simple program like turning on and of a LED or a motor.

I tried to compile a simple program of blinking LED in Arduino Mega ADK and it threw me a lots of errors:

That is NOT a simple program to blink an LED. If it were, you would have no need to include:

#include <Max3421e.h>
#include <Usb.h>
#include <AndroidAccessory.h>

or have

AndroidAccessory  acc("Manufacturer","Model","Description","1.0",
"http://yoursite.com", "0000000012345678");

nor would you be using

if (acc.isConnected()) {
int len = acc.read(msg, sizeof(msg), 1); // read data into msg variable

The first error message you get:

F:\Arduino\arduino-1.0\libraries\USB_Host_Shield/Max3421e.h:37:22: error: WProgram.h: No such file or directory

Did you bother searching for that error message? That message has only been posted a few hundred times this year, and it has been answered nearly as many times. It’s getting old, now, though. Go find the answer yourself this time.

I have also been trying to get the same ADK example working. I'm still searching but so far have found that Arduino 1.0 broke the libraries used for the examples.

Some people recommend using the new CapSense for Arduino 1.0: http://www.arduino.cc/playground/Main/CapSense Also, the USB-Host library has now been updated for 1.0: https://github.com/ribbotson/USB-Host I'm still having problems with the AndroidAccessory library which seems to reference deprecated features.