I'm trying to replicate this: https://zhengludwig.wordpress.com/projects/self-driving-rc-car/ using pretty much the exact same controller and car.
I've soldered 4 wires to the controller, 1 for each direction. If I let the wires touch the ground on the controller everything works perfect. However, when I connect the wires to the Arduino nothing works. Sometimes left/right works for about 0.5 seconds then it goes back to doing nothing. Any idea on what the problem might be? Do I need to connect the controllers ground to the Arduino ground?
I've tried removing the batteries from the controller and connecting 3.3V and ground from the Arduino, which sorta works but I feel like it shouldn't be needed.
If I use the buttons on the controller while it's connected to the Arduino it goes either forward, right or forward+right.
The code I'm using to test everything looks like this:
void setup() {
//Initialize the pins and serial
pinMode(reversePin, OUTPUT);
pinMode(forwardPin, OUTPUT);
pinMode(leftPin, OUTPUT);
pinMode(rightPin, OUTPUT);
}
void reset() {
digitalWrite(forwardPin, HIGH);
digitalWrite(reversePin, HIGH);
digitalWrite(leftPin, HIGH);
digitalWrite(rightPin, HIGH);
}
void loop() {
// put your main code here, to run repeatedly:
reset();
digitalWrite(forwardPin, LOW);
delay(4000);
reset();
digitalWrite(reversePin, LOW);
delay(4000);
reset();
digitalWrite(leftPin, LOW);
delay(4000);
reset();
digitalWrite(rightPin, LOW);
delay(4000);
}