ROBOT MINI SUMO CON ARDUINO NANO Y DRIVER TB6612FNG
ROBOT MINI SUMO CODIGO ARDUINO //FUNCIONAL 5 AGOSTO 2024 //AL COMIENZO DEL PROGRAMA DEFINIMOS EN QUE PINES IRAN CONECTADOS LOS DISTINTOS DISPOSITIVOS //LINEA BLANCA = 0 ---- LINEA NEGRA = 1 #include <GyverOLED.h> GyverOLED<SSD1306_128x32, OLED_BUFFER> oled; #include <GP2Y0A21YK.h> #define PIN_PSD ( A2 ) GP2Y0A21YK *psd; #define sensorIzquierdo 11 #define sensorDerecho 10 #define boton 2 //pin 4 y pin negativo #define STBY 3 #define Ain1 9 #define Ain2 8 #define Bin1 7 #define Bin2 4 #define PwmA 5 #define PwmB 6 double distance; //DECLARAMOS UNA SERIE DE VARIABLES PARA HACER EL PROGRAMA MAS LEGIBLE Y PRÁCTICO int estadoSensorDerecho; //Variable que almacena el estado del sensor Derecho int estadoSensorIzquierdo; //Variable que almacena el estado del sensor Izquierdo int modo = 1 ; // si pista fondo negro linea blanca usar 0 // si pista fondo blanco linea negra usar 1 int estadoBoton = 0 ; int estadorepo...