Entradas

Mostrando entradas de febrero, 2024

Line-following car

 #include <DRV8833.h> // Esta instrucción incluye un fichero que nos permite manejar el DRIVER del motor con instrucciones fáciles  DRV8833 driver = DRV8833(); // Esta instrucción indica la creación del DRIVER virtual dentro del programa  // Declaración de variables enteras globales para nombrar los pines:  int sensorIzquierdo = 10; //Pin de conexión sensor seguidor de línea Izquierdo int sensorDerecho = 2; //Pin de conexión sensor seguidor de línea Derecha  int valorIzquierdo;  int valorDerecho;  int motorA1 = 5 ; //Pin de conexión de los motores. int motorA2 = 6; int motorB1 = 11; int motorB2 = 3; int velocidadMotorA =110; //Se define la velocidad para los motores A y B  int velocidadMotorB = 100; void setup() {   // Código de configuración que se ejecuta una sola vez:      // Configurar los pines como entradas o como salidas      pinMode (sensorIzquierdo, INPUT);   //Pin de salida seguidor de línea izquierda   pinMode (sensorDerecho, INPUT); //Pin de salida seguidor de línea d

Forward rolling Code

 #include <DRV8833.h>  DRV8833 driver = DRV8833();  int motorA1 = 5 ; int motorA2 = 6; int motorB1 = 11; int motorB2 = 3; int Pot = 0; int valor;  void setup() {    Serial.begin(9600);    driver.attachMotorA(motorA1, motorA2);   driver.attachMotorB(motorB1, motorB2);  } void loop() {      valor= analogRead(Pot)/4;    driver.motorAForward(110);    driver.motorBForward(90);   Serial.println(valor);   }

Explicación_Rodamiendo hacia adelante - Forward rolling

  Library Inclusion : The line  #include <DRV8833.h>  includes a library called  DRV8833.h . This library likely provides functions and definitions related to controlling a motor driver module. The  DRV8833  library is designed for the  Pololu DRV8833 dual motor driver carrier . Motor Driver Initialization : The line  DRV8833 driver = DRV8833();  creates an instance of the  DRV8833  class called  driver . This instance will be used to control the motor driver. Pin Definitions : The following lines define pin numbers for various components: int motorA1 = 5;  and  int motorA2 = 6; : These are the pins connected to one of the motor channels (Motor A). int motorB1 = 11;  and  int motorB2 = 3; : These are the pins connected to the other motor channel (Motor B). int Pot = 0; : This defines an analog input pin (probably connected to a potentiometer). Setup Function : The  setup()  function is executed once when the Arduino starts. Inside  setup() , we do the following: Serial.begin(9600

Explicación para el seguidor de línea

Imagen
Robot URFI Explicación para el seguidor de línea (Pista) Line-following  The  line sensor  is composed of an  infrared light-emitting LED diode  and a  photodiode  that detects infrared light. These diodes function as both emitters and receivers of signals, allowing the URFI robot to determine whether it is positioned  on or off a line .  Code and explanation: Library Inclusion : The code begins by including a library called  DRV8833 . This library allows us to control a motor driver (which manages the motors) using simple instructions. Driver Initialization : Next, we create an instance of the  DRV8833  driver and name it  driver . Think of this as setting up a virtual motor driver within our program. Pin Declarations : We declare some global integer variables to represent pin numbers: sensorLeft  and  sensorRight : These are the pins connected to the left and right line follower sensors. motorA1 ,  motorA2 ,  motorB1 , and  motorB2 : These are the pins connected to the motor driver f

Drivers to start the Mbots

https://drive.google.com/file/d/1CgJjINU-bn5aS8CjgRHzIA23CJz871cW/view