Hello everyone,
I'm using a serial communication (USB) for Raspberry Pi 4 B to code and power supply an Aruino Uno.
I have selected the port "/dev/ttyACM0" however I'm getting "An error occurred while uploading the sketch"
I'm trying to apload the following code :
#define EN2 8
#define DIR2 9
#define ST2 10
void setup(){
pinMode(EN2, OUTPUT);
pinMode(DIR2, OUTPUT);
pinMode(ST2, OUTPUT);
}
void loop(){
// if (Serial.available() > 0) {
// String data = Serial.readStringUntil('/n');
// Serial.println(data);
// if (data == "Go"){
digitalWrite(EN2, HIGH);
digitalWrite(DIR2, HIGH);
digitalWrite(ST2, HIGH);
delayMicroseconds(5000);
//delay(1);
digitalWrite(ST2, LOW);
//delay(1);
delayMicroseconds(5000);
//if (data == "S"){digitalWrite(EN2, LOW);}
//}
}
Please help.
Thank you in advance.