Ontario
Offline
Newbie
Karma: 0
Posts: 16
Starting from scratch is an understatement!
|
 |
« Reply #2 on: February 26, 2012, 07:09:47 am » |
The problem is that I had difficulty getting the Razor board to communicate through serial 0Rx/1Tx to the Arduino. What I have now found out was:
1) I am on the wrong page. Should have posted this probably in the sensors page. 2) It was not clear to me at the time but RX0 and TX1 are used by the USB. So by using SoftwareSerial I am now getting something through to the Arduino from the Razor. Now I just need to make it make sense. I should be getting this: (Acquired through 3.3V FTDI basic board)
!, AN:0, 0, 0, X 9, Y 5, Z 241, 284, -183, -175 !, AN:0, 0, 0, X 10, Y 4, Z 240, 284, -183, -175 !, AN:0, 0, 0, X 11, Y 3, Z 242, 284, -183, -175 !, AN:0, 0, 0, X 13, Y 3, Z 240, 284, -183, -175
But I get this:
19
9
9
82
83
83
166
33
So now the question is how do I make it look correct? Here is the code:
#include <SoftwareSerial.h>
// software serial #1: TX = digital pin 2, RX = digital pin 3 SoftwareSerial portOne(2, 3);
int stuff1;
void setup() { // Start the hardware serial port Serial.begin(9600); // Start software serial port portOne.begin(9600); }
void loop() { if (portOne.available()) { stuff1 = portOne.read(); Serial.println (stuff1); }
}
|