Electronic – Arduino ADK + Android LED blink example compiling errors

androidarduino

I'm trying to make a project using the Arduino ADK board and a Sony Ericsson Xperia Play running Android 2.3.4. For starters all I want to do is blink a LED from my Android device, using the nice tutorial found here. I managed to compile the Android app but I'm having big difficulties on the Arduino sketch. I can't resolve the imports and it won't compile. I understant there are some Arduino IDE version issues. I tried compiling on both 0023 and on 1.0. The furthest I could go with the code was getting these compile errors:

D:\arduino-0023\libraries\AndroidAccessory/AndroidAccessory.h:37: error: 'EP_RECORD' does not name a type
D:\arduino-0023\libraries\AndroidAccessory/AndroidAccessory.h:50: error: 'EP_RECORD' has not been declared
D:\arduino-0023\libraries\AndroidAccessory/AndroidAccessory.h:50: error: 'EP_RECORD' has not been declared
D:\arduino-0023\libraries\AndroidAccessory/AndroidAccessory.h:64: error: 'USB_NAK_LIMIT' was not declared in this scope

I think I read the whole documentation and I can't find a solution to my problem. Setting this up is such a pain… I really need to make this work.

Best Answer

The library was written and tested in:

Arduino Alpha 0022

Have you tried this?

#if defined(ARDUINO) && ARDUINO >= 100
  #include "Arduino.h"
#else
  #include "WProgram.h" #endif