Hello,
I’m just starting to play around with program the motors of the 3pi, and had input the following sketch, very simply to move the robot forward a tiny amount.
#include <OrangutanMotors.h>
OrangutanMotors motors;
unsigned long prevMillis = 0;
int Beatlength=250;
int Speed = 128;
void frontStep(int beats)
{
motors.setSpeeds(Speed,Speed);
delay(beats*Beatlength);
}
void setup() // run once, when the sketch starts
{
}
void loop() // run over and over again
{
frontStep(4);
}
I compiled using the Arduino software version 0012, having made the modifications necessary to use it to program the Orangutang as suggested, and uploaded using the Orangutang programmer. I should add, I have been able to upload numerous other example sketches multiple times with no problem.
And this one, too, loaded just fine. The problem now is that when I power up the 3Pi, the motors move forward for a tiny bit of time, then the robot powers down. This does not give me enough time to reprogram with the next iteration of the sketch, no matter how closely I try to time the upload/turn-on sequence. Any way I can regain control of the robot? Also, by the way, why isn’t the frontStep command repeated over and over again?
Thanks,
Rich