Hi
I decided not going to program the robot from within Wiring but from the Atmel AVR IDE and send Rx/Tx messages to it from a Wiring S board. Here's a sample code to do that from Wiring using the slave program example in the Pololu documentation:
/**
* Pololu 3pi Control
*
* Assumes slave program in Pololu: http://www.pololu.com/docs/0J21/10.a
*/
char msg; // command to send to 3pi
int statuspin = 15;
void setup()
{
Serial1.begin(115200);
pinMode(statuspin, OUTPUT);
}
void loop()
{
/*
if (Serial.available()) // if data available
{
val = Serial.read(); // read data
Serial.print(val); // print it back
}
*/
delay(100);
digitalWrite(statuspin, HIGH);
msg = '\xB7'; // clear screen
Serial1.write(msg);
msg = '\xBA'; // autocalibrate
Serial1.write(msg);
delay(1500);
msg = '\xB8'; // print
Serial1.write(msg);
Serial1.write(8);
Serial1.print("Wiring S");
msg = '\xB9'; // next line
Serial1.write(msg);
Serial1.write(0);
Serial1.write(1);
msg = '\xB8'; // print
Serial1.write(msg);
Serial1.write(8);
Serial1.print("PWNS 3pi");
digitalWrite(statuspin, LOW);
delay(5000); // wait 5s for next read
}