Forum >romeo and speed control
romeo and speed control

Hi Guys, hope you are all well?.
im using the romeo board and the case statements (wasd) for movement.
case 'w'://Move Forward
advance (1000,1000); //PWM Speed Control
break;
the motors im using also turn at 750 as well as 1000,
i tried adding in a second subroutine, mimicking the "advance" sub, called advance1 with values set at 750
case 'q'://Move Forward
advance1 (750,750); //PWM Speed Control
break;
but it does not change the speed. my question is how can i change the speed via serial command???
thanks guys
im using the romeo board and the case statements (wasd) for movement.
case 'w'://Move Forward
advance (1000,1000); //PWM Speed Control
break;
the motors im using also turn at 750 as well as 1000,
i tried adding in a second subroutine, mimicking the "advance" sub, called advance1 with values set at 750
case 'q'://Move Forward
advance1 (750,750); //PWM Speed Control
break;
but it does not change the speed. my question is how can i change the speed via serial command???
thanks guys
2012-02-21 20:22:53 thanks for your responses guys,
heres my advance sub
int E1 = 5; //M1 Speed Control
int E2 = 6; //M2 Speed Control
int M1 = 4; //M1 Direction Control
int M2 = 7; //M1 Direction Control
int Relay = 3;
///////////////////////
///For previous Romeo, please use these pins.
//int E1 = 6; //M1 Speed Control
//int E2 = 9; //M2 Speed Control
//int M1 = 7; //M1 Direction Control
//int M2 = 8; //M1 Direction Control
/////////////////////////
void stop(void) //Stop
{
digitalWrite(E1,LOW);
digitalWrite(E2,LOW);
}
void advance(char a,char b) //Move forward
{
analogWrite (E1,a); //PWM Speed Control
digitalWrite(M1,HIGH);
analogWrite (E2,b);
digitalWrite(M2,HIGH);
the motors are buried deep within a hull of a rc ferry and using the supplied 7.2 volt battery pack. neither motor turned if value was set at (100,100) or at 600 just the noise, 750 was enough to make them move and at 1000 they turned like they did wen 12v was run directly to them.weird much.
bkrause
heres my advance sub
int E1 = 5; //M1 Speed Control
int E2 = 6; //M2 Speed Control
int M1 = 4; //M1 Direction Control
int M2 = 7; //M1 Direction Control
int Relay = 3;
///////////////////////
///For previous Romeo, please use these pins.
//int E1 = 6; //M1 Speed Control
//int E2 = 9; //M2 Speed Control
//int M1 = 7; //M1 Direction Control
//int M2 = 8; //M1 Direction Control
/////////////////////////
void stop(void) //Stop
{
digitalWrite(E1,LOW);
digitalWrite(E2,LOW);
}
void advance(char a,char b) //Move forward
{
analogWrite (E1,a); //PWM Speed Control
digitalWrite(M1,HIGH);
analogWrite (E2,b);
digitalWrite(M2,HIGH);
the motors are buried deep within a hull of a rc ferry and using the supplied 7.2 volt battery pack. neither motor turned if value was set at (100,100) or at 600 just the noise, 750 was enough to make them move and at 1000 they turned like they did wen 12v was run directly to them.weird much.

2012-02-21 18:20:42 ViennaMike is correct. In case you've done some mapping, could you please post your advance function.
Usually, pwm is range from 0-255, for any value over 255 has no additional effect rather than 255.
R2D2C3PO
Usually, pwm is range from 0-255, for any value over 255 has no additional effect rather than 255.

2012-02-21 17:49:47 PWM values range from 0 to 255. Try 255, see if you get the same speed, and then try 150 for slower.
ViennaMike
