Hello! I just started using Arduino with a robot smart car (made by Elegoo using the Arduino Genuino board). The code I am using works fine, I am using a Bluetooth chip to control the car with my phone. The car goes forward and backwards fine, but when I go left and right it goes just a little bit and then starts to whine. I have seen it go right and left correctly once but I don’t know how I made it do that. Does anyone have any ideas? Thank you!
You have not given us much to go on.
How about posting a link to a short YouTube video showing the behaviour and allowing us to hear the noise you mention.
How about telling us how the car works - for example, what mechanism is used for steering?
And anything else you can think of that might help us to help you. We are not mind readers.
...R
Look at the code.
Option 1)
Where you see
#define carSpeed 150
Change it to a higher value (up to 255)
The problem with this is that it will cause the initial carSpeed to be faster.
Option 2)
Leave the #define carSpeed 105 the way it is and then later in the code type + and a value that you want to increase the speed by (i.e. if you want it to turn at the fastest speed you would type +105) after carSpeed in the void right and void left sections of the code
Example:
void left(){
analogWrite(ENA,carSpeed+105);
analogWrite(ENB,carSpeed+105);
digitalWrite(IN1,LOW);
digitalWrite(IN2,HIGH);
digitalWrite(IN3,LOW);
digitalWrite(IN4,HIGH);
Serial.println("Left");
}
void right(){
analogWrite(ENA,carSpeed+105);
analogWrite(ENB,carSpeed+105);
digitalWrite(IN1,HIGH);
digitalWrite(IN2,LOW);
digitalWrite(IN3,HIGH);
digitalWrite(IN4,LOW);
Serial.println("Right");
I hope this helps. I am new at this myself. There may be more elegant ways to do this.
Aloha,
smalinger
Hi,
Welcome to the forum.
Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
Thanks.. Tom...