I'm using a pair of ArduiMU's (http://www.sparkfun.com/products/9956) and a pair of series 1 Xbees to talk to another Xbee + USB explorer, which is hooked up to my computer.
The ArduiMU is basically an Arduino + 3axis gyro + 3axis accel all rolled into one.
All the sensor data will eventually live in Max/MSP on my computer.
At first I setup and used Maxuino (http://www.maxuino.org/) to get the sensor data into Max. Other than seeming like overkill (being able to set pinmodes from max) it works fine. I'm getting sensor values in just fine.
Now here's the problem.
I have have two of these boards, spitting out serial data over two Xbees, which I need to know which is which on the computer side.
Meaning, I can't just use the Maxuino firmware/max patch as it doesn't account for that possibility.
I need to then roll my own code for the Arduinos which tags each one.
I don't need (m)any bells and whistles so something like the "virtual color wheel" sketch would be ideal.
Just serial.print(analogRead(whatever)); etc...
and I guess just adding a tag before or after it to label the individual sensors and unit they came from.
Now this isn't much of an issue here as it's pretty straight forward. I'd need to figure out the parsing side on the computer end, but that's another topic/issue.
The actual problem is this.
The ArduiMU is sending out analog data on analog pins 0, 1, 2, 3, 6 and 7. Yes 7.
As far as I know, 328-based Arduino variants only have 6 analog ins(0-5). This is sending out 8 outputs worth of stuff (I'm getting numbers on analog 4 and 5, but they just echo 3).
Here's the schematic and board layout for the ArduiMU:
http://api.ning.com/files/Odb*eaGUT14vgHAaXa1n08FSPLWp*1lS4Hv*e9TfK0OiS*wVxxOSej3zahMBd52*aqDdfWE30dlIcRiOWo-3EqvXctRtijkL/6DOFArduIMUv20sch.pdf">6DOF-ArduIMU-v20-sch.pdf
I followed all the traces and saw that one of the sensors is coming in on pin22 of the 328, which is labelled as ADC7 on the datasheet.
So basically, can I call for that pin in a regular sketch?
So if I want to read 6 analog pins, label the unit that is sending them, and the sensor data type, would it be something like this:
(so hopefully the data comes out as "whicharduino/sensor/value, " so in the X axis of the Accel it would say "1/ax/520,"
const int ax = A0;
const int ay = A1;
const int az = A2;
const int gx = A6;
const int gy = A7;
const int gz = A3;
void setup()
{
Serial.begin(57600);
}
void loop()
{
Serial.print("1/");
Serial.print("ax/");
Serial.print(analogRead(ax));
Serial.print(",");
Serial.print("1/");
Serial.print("ay/");
Serial.print(analogRead(ay));
Serial.print(",");
Serial.print("1/");
Serial.print("az/");
Serial.println(analogRead(az));
Serial.print(",");
Serial.print("1/");
Serial.print("gx/");
Serial.print(analogRead(gx));
Serial.print(",");
Serial.print("1/");
Serial.print("gy/");
Serial.print(analogRead(gy));
Serial.print(",");
Serial.print("1/");
Serial.print("gz/");
Serial.println(analogRead(gz));
}