I am trying to hack a cheap RC car as to be able to control it using my Arduino. I took apart the cars remote controller and found the pins that make it go forwards, backwards, left, and right. So I soldered 4 jumper wires to these pins and connected them to the Arduino as follows: Pin 8 - Left Pin 9 - Right Pin 10 - Forwards Pin 11 - Backwards I found the remote controller is controlled by a chip called TX-2E, I checked the data sheet online and found that if any of the pins that control the pins motion are ground, the car will move in that corresponding direction. So if the forwards pin is grounded the car is supposed to move forwards. To test this, I connected each jumper wire to ground on the Arduino individually and found that it worked as described on the datasheet.
Then I decided to create a sketch that makes the car move forwards for 1 second and backwards for 1 second, it worked as expected.
Then I wrote a sketch that makes the wheels turn left for 1 second and then turn right for 1 second. But it didn't work as expected instead the wheel turned left for 1 second, went to neutral for a second.
I wasn't sure what was wrong, but I decided to run a sketch that should move the car forwards for 1 second, move it backwards for 1 second, turn the wheels left for 1 second, and then turn right for 1 second. But all it actually did was just turn left for 1 second every couple of seconds. I removed the jumper wire connected to pin 8 that is supposed to control the wheels turning left, while the sketch was running and everything worked as expected except the turning left part. it moved forwards for 1 second, moved back for a second, waited at neutral for a second, and then turned right for a second. When I connected back the jumper wire that controls the car moving left everything stops working again. I am not sure whats wrong, I even connected a multimeter to each pin and found they were pulsing between 0V and 5V as expected but for some reason they weren't moving the car, it was only moving left, in this case at least. Any help to get this working, ideas to why its not working, or any troubleshooting tips would be greatly appreciated. Below you can find the code for the sketch, that is supposed to move the car forwards, backwards, left and right.
const int LEFT = 8;
const int RIGHT = 9;
const int FWD = 10;
const int BWD = 11;
void reset () {
//Sets all pins to HIGH as the car moves when the pins are grounded.
//And we want the car to start out by not moving.
digitalWrite(LEFT, HIGH); //For some reason everything works when I remove this
digitalWrite(RIGHT, HIGH);
digitalWrite(FWD, HIGH);
digitalWrite(BWD, HIGH);
}
void setup() {
// put your setup code here, to run once:
pinMode(RIGHT, OUTPUT);
pinMode(FWD, OUTPUT);
pinMode(BWD, OUTPUT);
pinMode(LEFT, OUTPUT);
reset();
}
void Forward(){
digitalWrite(FWD, LOW);
delay(1000);
digitalWrite(FWD,HIGH);
delay(1000);
}
void Backward(){
digitalWrite(BWD, LOW);
delay(1000);
digitalWrite(BWD, HIGH);
delay(1000);
}
void Left(){
digitalWrite(LEFT, LOW);
delay(1000);
digitalWrite(LEFT, HIGH);
delay(1000);
}
void Right(){
digitalWrite(RIGHT, LOW);
delay(1000);
digitalWrite(RIGHT, HIGH);
delay(1000);
}
void loop() {
Forward();
Backward();
Left();
Right();
}