Go Down

Topic: Trouble connecting RAZR M to mega 2560 (Read 559 times) previous topic - next topic

Mrbowtie

Hello all,
 I am having trouble connecting my RAZR M to my mega 2560. I am using the book Beginning Android ADK
with Arduino, and using their sketch have encountered an error compiling on the IDE.
   The book says to Copy both library folders found at ADK_release_xxxx\firmware\arduino_libs\ to the libraries folder of the
Arduino IDE installation at arduino-xxxx\libraries. I have copied the files and placed them into the arduino IDE program files but not sure if I have put them in the right spot.
   In their sketch I do not understand this part

AndroidAccessory acc("Manufacturer", "Model", "Description",
"Version", "URI", "Serial");

Do I write the model and manufacture of my phone there?
I know this is simple for the majority of you guys but a little help would this frustrated guy out a ton,  i hate to admit I have been grinding on this for a week and a half.


This is my full sketch
Code: [Select]
#include <Max3421e.h>
#include <Usb.h>
#include <AndroidAccessory.h>
#define ARRAY_SIZE 12
AndroidAccessory acc("Manufacturer", "Model", "Description",
"Version", "URI", "Serial");
char hello[ARRAY_SIZE] = {'h','e','l','l','o',' ',
'w','o','r','l','d','!'};
void setup() {
Serial.begin(115200);
acc.powerOn();
}
void loop() {
if (acc.isConnected()) {
for(int x = 0; x < ARRAY_SIZE; x++) {
Serial.print(hello[x]);
delay(250);
}
Serial.println();
delay(250);
}
}


This is the errors I am getting

(error)   In file includeed from sketch_jan13a.ino:1:
C:\users\Bears\Documents\programs\arduino-1.0.2\libraries\usb_hostShield/max3421e.h:37:22:  error No such file or directory In file included from sketch_jan13a.ino:1: (error)

This repeats probably 50 times, I have put those files in every conceivable place and still an error in compiling.   Any Help would be great Thanks in advance

PaulS

Quote
I have put those files in every conceivable place and still an error in compiling.

Given the path in the error message, you are installing user-downloaded libraries in the wrong place. The path C:\users\Bears\Documents\programs\arduino-1.0.2\libraries is for core libraries, NOT for user downloaded libraries.

Do you have a path C:\users\Bears\Documents\Arduino? This would be where your sketches are saved. If so, do you have a libraries directory in it? If not, make one. THAT is where user downloaded libraries go.

Mrbowtie

    Thank you for responding PaulS,
  I do have a  C:\users\Bears\Documents\Arduino path with an existing libraries file.
I have copied the usb files into that file and stil come up with errors when trying to compile the sketch. 
Any help would be great

 

PaulS

Quote
I have copied the usb files into that file

I hope you mean MOVED. Show a screen shot of the libraries directory in the Arduino directory.

Mrbowtie

I cant seem to get a screen shot but I have an arduino folder
with two sketch folders and a libraries folder I have moved those
files into that libraries folder. You say libraries directory, am I not setting it up right?
I have been over and over setting up libraries on this site. Thanks again for the help.

PaulS

Quote
I cant seem to get a screen shot but I have an arduino folder
with two sketch folders and a libraries folder

You should have one sketch folder. That folder should contain a libraries folder. That folder should contain the usb_hostShield folder. That folder should contain the max3421e.h and max3421e.cpp files.

Mrbowtie

I have tried to put a libraries folder in the sketch folder. It did not work. I just tried it again put a libraries folder then put the usb folder in that which contain themax3421e.h and max3421e.cpp files you mentioned. Again it did not compile.. I'm beginning to think it does not like me.  Any other suggestions?

michinyon

I don't know about yours,  but my Razr M phone is not an android device.

Mrbowtie

michinyon,
  Thank you for the reply but yes the Motorola droid RAZR M is definitely an android device.

Go Up