Hola, tengo el problema de que el programa no quiere ser subido, puede que sea porque compre un nuevo cable para subir el código, pero si alguien sabe como puedo arreglarlo seria de gran ayuda, gracias.
Este es el código:
int enA = 3;
int in1 = 2;
int in2 = 4;
int in3 = 7;
int in4 = 6;
int enB = 5;
int m;
int n;
int r;
int speed = 120;
int infra1 = 8;
int infra2 = 9;
int infra3 = 10;
void setup() {
pinMode (enA, OUTPUT);
pinMode (in1, OUTPUT);
pinMode (in2, OUTPUT);
pinMode (in3, OUTPUT);
pinMode (in4, OUTPUT);
pinMode (enB, OUTPUT);
pinMode (infra1, INPUT);
pinMode (infra2, INPUT);
pinMode (infra3, INPUT);
Serial.begin (9600);
}
void loop() {
m = digitalRead (infra1);
n = digitalRead (infra2);
r = digitalRead (infra3);
Serial.print (m);
Serial.print (n);
Serial.println (r);
if (m == 0 && n == 0 && r == 0 ) {
digitalWrite (in1, LOW);
digitalWrite (in2, HIGH);
digitalWrite (in3, LOW);
digitalWrite (in4, HIGH);
analogWrite (enA, HIGH);
analogWrite (enB, HIGH);
delay (20);
analogWrite (enA, speed);
analogWrite (enB, speed);
delay (50);
}
if (m == 1) {
digitalWrite (in1, LOW);
digitalWrite (in2, HIGH);
digitalWrite (in3, LOW);
digitalWrite (in4, LOW);
analogWrite (enA, speed);
analogWrite (enB, speed);
delay (20);
}
if (r == 1) {
digitalWrite (in1, LOW);
digitalWrite (in2, LOW);
digitalWrite (in3, LOW);
digitalWrite (in4, HIGH);
analogWrite (enA, speed);
analogWrite (enB, speed);
delay (20);
}
}
Este es el mensaje de error:
Arduino:1.8.5 (Windows 7), Tarjeta:"Arduino/Genuino Uno"
El Sketch usa 3090 bytes (9%) del espacio de almacenamiento de programa. El máximo es 32256 bytes.
Las variables Globales usan 194 bytes (9%) de la memoria dinámica, dejando 1854 bytes para las variables locales. El máximo es 2048 bytes.
Using proxy DIRECT
Using proxy DIRECT
Using proxy DIRECT
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x8c
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x8c
Problema subiendo a la placa. Visita http://www.arduino.cc/en/Guide/Troubleshooting#upload para sugerencias.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x8c
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x8c
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x8c
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x8c
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x8c
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x8c
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x8c
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x8c