Ir al contenido principal

Entradas

Mostrando entradas de febrero, 2026

ESQUEMA DE CONEXION + CODIGO SEGUIDOR DE LINEA

  #define IR_SENSOR_RIGHT 11 #define IR_SENSOR_LEFT 12 #define MOTOR_SPEED 180 //Right motor int enableRightMotor=6; int rightMotorPin1=7; int rightMotorPin2=8; //Left motor int enableLeftMotor=5; int leftMotorPin1=9; int leftMotorPin2=10; void setup() {   //The problem with TT gear motors is that, at very low pwm value it does not even rotate.   //If we increase the PWM value then it rotates faster and our robot is not controlled in that speed and goes out of line.   //For that we need to increase the frequency of analogWrite.   //Below line is important to change the frequency of PWM signal on pin D5 and D6   //Because of this, motor runs in controlled manner (lower speed) at high PWM value.   //This sets frequecny as 7812.5 hz.   TCCR0B = TCCR0B & B11111000 | B00000010 ;      // put your setup code here, to run once:   pinMode(enableRightMotor, OUTPUT);   pinMode(rightMotorPin1, OUTPUT);   pinMode(rightMotorPin...