I am new to the arduino universe, so please be patient.
I am trying to get Elegoo Smart Car v4.0 to work with the code as shown in the "Elegoo Smart Car Issues" post from Apr 20.
When I upload the 'factory sketch', I can controll the car using the provided remote without issues. Therefore I assume, that the hardware assembly is correct. My own sketch runs without errors and the tutorial I am following suggests, that it is working with Smart Car V3. However, it does not do anything with the V4 Car. My basic assumption is, that some pins have changed, but I am unable to find a mapping by looking at the SmartCar Shield and I couldnt find any data sheet. Did anyone get this to work?
For reference I added the code again, but be aware that it has already been veryfied by the thread I referred to above. I only added some print statements for debugging.
int ENA=5;
int ENB=6;
int IN1=7;
int IN2=8;
int IN3=9;
int IN4=11;
void setup() {
// setup code
pinMode(ENA,OUTPUT);
pinMode(ENB,OUTPUT);
pinMode(IN1,OUTPUT);
pinMode(IN2,OUTPUT);
pinMode(IN3,OUTPUT);
pinMode(IN4,OUTPUT);
// enable motors
digitalWrite(ENA,HIGH);
digitalWrite(ENB,HIGH);
}
void loop() {
Serial.begin(9600);
Serial.println("Running Actions");
// Right Turn
digitalWrite(IN1,HIGH);
digitalWrite(IN2,LOW);
digitalWrite(IN3,HIGH);
digitalWrite(IN4,LOW);
Serial.println("right");
delay(1000);
//Left Turn
digitalWrite(IN1,LOW);
digitalWrite(IN2,HIGH);
digitalWrite(IN3,LOW);
digitalWrite(IN4,HIGH);
Serial.println("left");
delay(1000);
//forward
digitalWrite(IN1,HIGH);
digitalWrite(IN2,LOW);
digitalWrite(IN3,LOW);
digitalWrite(IN4,HIGH);
Serial.println("back");
delay(1000);
//backwards
digitalWrite(IN1,LOW);
digitalWrite(IN2,HIGH);
digitalWrite(IN3,HIGH);
digitalWrite(IN4,LOW);
Serial.println("Forward");
delay(1000);
Serial.println("Done");
while (true) {
// stop here
}
}