I Thought I would also share that I also have also converted the rover code to run on the Arduino and I have specifically tested it with a Beta version of the Botboarduino.
Currently I am using a Roboclaw on my Tri-track with a PS2. This code was based on a stripped down version of the Rover with Arm code that was done earlier by Xan, which I hacked up. I am not using Arm on this Rover but I do have the code working with a Pan and Tilt.
The code can be configured to run in PWM mode or in Packet Serial mode. Both of these modes should also be compatible with the Sabertooth 2x15 and the PWM mode should work on the Sabertooth 2x15 RC. Have not tried it, but I do have an old 2x10 which I could try if need be…
Right now I think the PWM/RC mode runs smoother on the Botboarduino as the Packet Serial mode uses SoftwareSerial to talk to the controller board, which works fine at 19200, but the SoftwareSerial class disables interrupts while it is outputting (or inputting) a byte, which makes sure that the data gets out there properly, but this causes the servo code to not be able to process interrupts, so you may get delays in the servo pulses… Always a trade off.
But the Packet Serial mode has advantages on the Roboclaw in that you can then use the encoders…
Like the other Sketches I have uploaded, this one also depends on several external libraries. These include:
0)My servoEx library: You can download from the Brat thread: viewtopic.php?f=48&t=7590
-
PS2X_LIB: which you can get more information including pointers for download at: billporter.info/?p=240
-
Streaming: Because I am lazy: arduiniana.org/libraries/streaming : I find it easier to do:
Serial << "Blah: " << _DEC(myBlah) << endl;
Than have to do this with separate commands:
Serial.print("Blah: ");
Serial.println(myBlah, DEC); -
SoftwareSerial: Note: I am using the NewSoftSerial 11 beta, which I believe will become the new official software serial (arduiniana.org/2011/01/newsoftserial-11-beta/). Why? This is needed on the non-mega boards like Botboarduino as it adds support for things like Streaming (Based on stream class). Also it uses the PinChange interrupt for input, such that it can buffer input…
Again this is a Work In Progress, so …
The code is currently configured to run the motor controller using PWM mode and is set up to have a Pan and Tilt servo. I should warn that I was a bit lazy and did not retest the code in the other configurations, after I converted the code to use my Servo library… Sorry…
Kurt
Arduino_Rover-111202a.zip (8.66 KB)