Page 1 of 2

Has anyone ever actually used this board?

Posted: Sat Nov 05, 2011 12:03 pm
by rameses32
I just spent an entire day looking for anything to do with this board, and came up empty handed. I have the board and it looks great, performs just like the Eleven, I have no problems using the SD card. But I cannot find anything for the USB Host, I've down loaded the newest Arduino software, nothing for the USB, I've searched the internet , tried all of the different sketchs, all of them ask for usb.h and max3421E.h, managed to find them but when I try to compile there are hundreds of errors in the .h files. I cant even begin to write code from the ground up because there is no documentation on the usb side of things. Sorry, I know people have been using USB host with Arduino, I am just disappointed at the amount of time I have spent trying to just get started on this and have not even been able to make the first step.
Charley

Re: Has anyone ever actually used this board?

Posted: Sat Nov 05, 2011 1:02 pm
by rameses32
THis is one of the sketches I tried
/* MAX3421E USB Host controller SPI test */
/* This sketch tests SPI communication between Arduino and MAX3421E USB host controller */
#include <spi.h>
#include <max3421e.h>

void setup();
void loop();

byte i;
byte j = 0;
byte gpinpol_copy;

MAX3421E Max;

void setup()
{
Serial.begin( 9600 );
Max.powerOn();
delay(200);
}

void loop()
{
gpinpol_copy = Max.regRd( rGPINPOL );
Serial.println("SPI test. Each '.' indicates 64K transferred. Press any key to stop.");
while( Serial.available() == 0 ) {
for( i = 0; i < 255; i++ ) {
Max.regWr( rGPINPOL, i );
if( Max.regRd( rGPINPOL ) != i ) {
Serial.println("SPI transmit/receive mismatch");
}
}//for( i = 0; i < 255; i++
j++;
if( j == 0 ) {
Serial.print(".");
}
}//while( Serial.available() == 0
Max.regWr( rGPINPOL, gpinpol_copy );
Serial.println("\r\nStopped.");
while( 1 ); //stop here
}

Re: Has anyone ever actually used this board?

Posted: Sat Nov 05, 2011 1:04 pm
by rameses32
This is what I got while trying to compile it.

sketch_nov06a.cpp:3:17: error: spi.h: No such file or directory
In file included from sketch_nov06a.cpp:4:
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:135: error: missing terminating ' character
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:137: error: stray '\342' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:137: error: stray '\206' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:137: error: stray '\221' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:138: error: stray '\342' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:138: error: stray '\206' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:138: error: stray '\223' in program
In file included from sketch_nov06a.cpp:4:
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:250:133: error: invalid suffix "d7d482914" on integer constant
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:558: error: stray '#' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:558: error: stray '#' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:635: error: stray '#' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:635: error: stray '#' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:648: error: stray '#' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:668: error: stray '#' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:668: error: stray '#' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:688: error: stray '#' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:688: error: stray '#' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:706: error: stray '#' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:706: error: stray '#' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:773: error: stray '#' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:773: error: stray '#' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:796: error: stray '#' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:796: error: stray '#' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:803: error: stray '\342' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:803: error: stray '\206' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:803: error: stray '\220' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:807: error: stray '\342' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:807: error: stray '\206' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:807: error: stray '\222' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:811: error: stray '\342' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:811: error: stray '\206' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:811: error: stray '\221' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:815: error: stray '\342' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:815: error: stray '\206' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:815: error: stray '\223' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:825: error: stray '\342' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:825: error: stray '\206' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:825: error: stray '\220' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:829: error: stray '\342' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:829: error: stray '\206' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:829: error: stray '\222' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:833: error: stray '\342' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:833: error: stray '\206' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:833: error: stray '\221' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:837: error: stray '\342' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:837: error: stray '\206' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:837: error: stray '\223' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:880:3: error: invalid preprocessing directive #This
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:881: error: stray '##' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:882: error: stray '##' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:882: error: stray '##' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:882: error: stray '##' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:899:10: error: invalid suffix "a" on integer constant
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:900:10: error: invalid suffix "b" on integer constant
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:906:11: error: invalid suffix "a" on integer constant
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:907:11: error: invalid suffix "b" on integer constant
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:923: error: missing terminating ' character
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:934: error: stray '`' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:934: error: stray '`' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:934: error: stray '`' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:937: error: stray '$' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:940: error: stray '`' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:940: error: stray '`' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:940: error: stray '`' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:956: error: stray '`' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:956: error: stray '`' in program
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:4: error: expected unqualified-id before '<' token
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:117: error: expected constructor, destructor, or type conversion before '<' token
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:144: error: expected unqualified-id before '<' token
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:593: error: expected constructor, destructor, or type conversion before '<' token
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:634: error: expected unqualified-id before numeric constant
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:643: error: expected unqualified-id before '<' token
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:668: error: function definition does not declare parameters
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:668: error: expected unqualified-id before '>' token
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:688: error: function definition does not declare parameters
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:688: error: expected unqualified-id before '>' token
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:706: error: function definition does not declare parameters
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:706: error: expected unqualified-id before '>' token
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:773: error: function definition does not declare parameters
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:773: error: expected unqualified-id before '>' token
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:796: error: function definition does not declare parameters
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:796: error: expected unqualified-id before '>' token
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:881: error: expected constructor, destructor, or type conversion before '&' token
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:881: error: 'tag' does not name a type
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:882: error: expected constructor, destructor, or type conversion before '&' token
C:\Arduino\arduino-0022\libraries\Max/max3421e.h:882: error: expected constructor, destructor, or type conversion before '<' token

Re: Has anyone ever actually used this board?

Posted: Sat Nov 05, 2011 10:14 pm
by rameses32
I have tried all of the Sketches from Circuits@Home web page, all with the same result when I compile them, hundreds of errors. They must work, so I am definitely doing something wrong but for the life of me I can't figure out what. I downloaded the USB Host Shield library 2.0 and put it in a folder I called USB in the libraries folder, I am running the newest version of Arduino software.

Any help is greatly appreciated as I am at wits end here.

Re: Has anyone ever actually used this board?

Posted: Sat Nov 05, 2011 11:40 pm
by rameses32
Problem solved, I knew I was doing something wrong, I was putting the files in the wrong place, I was putting them in the libraries folder in Arduino instead of where my sketches are stored, I created a libraries folder in My Documents\Arduino and placed the files there and everything works perfectly now.

Charley

Re: Has anyone ever actually used this board?

Posted: Sun Nov 06, 2011 11:23 am
by jonoxer
Hey Charley, I apologise that I didn't even see this thread until after you'd already solved the problem! I hope it didn't cause you too much stress figuring it out.

We're aware that the USBDroid hasn't been documented very well yet, and it's pretty high on our priority list at the moment. A couple of people including AndyG (on this forum) have done a lot of work with it so we're hoping to have some guides up before long.
--
Jon

Re: Has anyone ever actually used this board?

Posted: Mon Nov 07, 2011 8:58 am
by rameses32
It did cause me a bit of stress as you can tell by the title of my original post, but again it was my fault. I have only ever used the libraries included with the Arduino software so I didn't know what to do with the new libraries, nothing to do with freetronics. All I can say is what a terrific board, the SD slot is easy to use and the USB Host works with all the sketches I have been able to find. I also picked up the 3 Axis accelerometer at the same time and it took all of about 1 minute to figure out, keep up the good work.
Charley

Re: Has anyone ever actually used this board?

Posted: Wed Nov 09, 2011 2:23 am
by geekscape
hi All,

A number of people at the Melbourne HackerSpace (http://hackmelbourne.org) are working on Android / Arduino projects using the USBDroid, including myself. We do have end-to-end software working with the USBDroid.

To build a complete application in this area involves several learning curves, including Android Java programming (UI and OpenADK), use of the Eclipse IDE, understanding the Android adb ... as well as the Arduino side of things, including getting code working on a USBDroid (based on an Uno), which is slightly different from the original Google OpenADK hardware reference, which used an ArduinoMega.

In regards to the Arduino side of things, for USBDroid you must use the Circuits@Home USBHostShield 2.0 library (not 1.0), which supports Uno based USB host controllers.

There are a number of basic tutorials out there, which cover all of the pieces of the puzzle, but they are either not targeted at the USBDroid, or incomplete, or too much hard-coding, or smash everything together into a complicated mess (no good for learning ... or as a basis of a good application).

I'm working (with others) on some complete end-to-end demonstration code, which is aimed at the USBDroid, is modular, flexible ... and with a bit of luck will be usable by people who don't want to tackle Android Java/Eclipse development and would prefer other simpler techniques for building their own Android UI.

There will be a tutorial written for this demonstration. Aiming to complete it as soon as possible.

Re: Has anyone ever actually used this board?

Posted: Sun Dec 25, 2011 10:43 am
by ninja2
rameses32 wrote:, I have no problems using the SD card.
Charley
Can you please describe how you access the microSD card, perhaps a pointer to resources or code examples? TIA

Re: Has anyone ever actually used this board?

Posted: Sun Dec 25, 2011 12:00 pm
by andrewduncan
Hi Ninja2,

I have recently bought the usbdroid for a project that I am working on. I hadn't intended to use the SD card for the project, but figured I would try it out as it may be useful for logging data. The SD library that comes with the Arduino IDE appears to work with the SD card on the usbdroid. There are a number of examples in the library (Files->Examples->SD).

Hope that helps!

Andrew