documentation
L298
Introduction :
The Motor Driver is a module for motors that allows you to control the working speed and direction of two motors simultaneously .This Motor Driver is designed and developed based on L298D
- Features and Specifications
- Operating voltage range: +5 to +46V
- Maximum supply voltage:50V
- Maximum Input and Enable Voltage:+7V
- Maximum current allowed to draw through each output: 3A
- TTL control inputs
- Total power dissipation:25W
- Operating temperature: -23°C to 130°C
- Storage Temperature: -40°C to 150°C
2.code arduino (exp 1):
int in1= 2; // Forward for motor A (left)int in2 = 3; // Reverse for motor A (Left)int ENA = 9; // Turns motor A on/offint in3 = 4; // Forward for motor B (Right)int in4 = 5; // Reverse for motor B (Right)int ENB = 10; // Turns motor B on/offvoid setup(){pinMode( in1, OUTPUT );pinMode( in2, OUTPUT );pinMode( ENA, OUTPUT );pinMode( in3, OUTPUT );pinMode( in4, OUTPUT );pinMode( ENB, OUTPUT );}void loop(){digitalWrite( ENA, HIGH );digitalWrite( in1, HIGH );digitalWrite( in2, LOW );digitalWrite( ENB, HIGH );digitalWrite( in3, HIGH );digitalWrite( in4, LOW );}3. l298d
INPUTS
|
FUNCTION
|
Q1=HIGH, Q2=LOW
|
Forward current
|
Q1=LOW,Q2=HIGH
|
Reverse current
|
Q1=Q2
|
stop
|
4. code arduino l298 (exp2 ):
const int Q1= 8;
const int Q2 = 9;
int EN1 = 11;
void setup()
{
pinMode(EN1, OUTPUT);
pinMode(Q1, OUTPUT);
pinMode(Q2, OUTPUT);
}
void loop()
{
sens1();
sens2();
stopp();
}
void sens1(){
analogWrite(EN1,255 );//sets the motors speeddigitalWrite(Q1, HIGH); digitalWrite(Q2, LOW);}void sens2(){analogWrite(EN1,255 );//sets the motors speeddigitalWrite(Q1, LOW); digitalWrite(Q2, HIGH);}void stopp(){analogWrite(EN1,0);//sets the motors speeddigitalWrite(Q1, LOW); digitalWrite(Q2, LOW);}
5.datasheet:link: https://www.sparkfun.com/datasheets/Robotics/L298_H_Bridge.pdf



Enregistrer un commentaire
0 Commentaires