รหัสสินค้า | SKU-00107 |
หมวดหมู่ | Driver stepper motor |
ราคา | 180.00 บาท |
สภาพ | สินค้าใหม่ |
ลงสินค้า | 19 ต.ค. 2559 |
อัพเดทล่าสุด | 5 มี.ค. 2563 |
Product description:
The L298N driver module, using ST L298N chip can directly drive two 3-30V DC motor, and provides a 5V output interface, you can chip circuitry to 5V power supply, support 3.3VMCU control, you can easily control the DC motor speed and direction, you can also control the 2-phase stepper motor, smart car essential.
Product parameters:
1 Driver chip: L298N dual H-bridge driver chip
2 Terminal driver part of the supply area VMS: +5V ~ +35V
3 Drive part of the peak current Io: 2A / Bridge
4 Logical part of the terminal power supply range Vss :4.5-5 .5V
5 Logical part of the operating current range: 0 ~ 36mA
6 The control signal input voltage range: 4.5-5.5V low 0V high
7 Maximum power consumption: 20W
8 Storage temperature: -25 ~ +130
9 Driver Board Size: 55mm * 60mm * 30mm
10 Driver board Weight: 33g
Code ควบคุมการทำงานด้วย Keyboard
//Keyboard Controls:
//
// 1 -Motor 1 Left
// 2 -Motor 1 Stop
// 3 -Motor 1 Right
//
// 4 -Motor 2 Left
// 5 -Motor 2 Stop
// 6 -Motor 2 Right
// Declare L298N Dual H-Bridge Motor Controller directly since there is not a library to load.
// Motor 1
int dir1PinA = 2;
int dir2PinA = 3;
int speedPinA = 9; // Needs to be a PWM pin to be able to control motor speed
// Motor 2
int dir1PinB = 4;
int dir2PinB = 5;
int speedPinB = 10; // Needs to be a PWM pin to be able to control motor speed
void setup() { // Setup runs once per reset
// initialize serial communication @ 9600 baud:
Serial.begin(9600);
//Define L298N Dual H-Bridge Motor Controller Pins
pinMode(dir1PinA,OUTPUT);
pinMode(dir2PinA,OUTPUT);
pinMode(speedPinA,OUTPUT);
pinMode(dir1PinB,OUTPUT);
pinMode(dir2PinB,OUTPUT);
pinMode(speedPinB,OUTPUT);
}
void loop() {
// Initialize the Serial interface:
if (Serial.available() > 0) {
int inByte = Serial.read();
int speed; // Local variable
switch (inByte) {
//______________Motor 1______________
case '1': // Motor 1 Forward
analogWrite(speedPinA, 255);//Sets speed variable via PWM
digitalWrite(dir1PinA, LOW);
digitalWrite(dir2PinA, HIGH);
Serial.println("Motor 1 Forward"); // Prints out “Motor 1 Forward” on the serial monitor
Serial.println(" "); // Creates a blank line printed on the serial monitor
break;
case '2': // Motor 1 Stop (Freespin)
analogWrite(speedPinA, 0);
digitalWrite(dir1PinA, LOW);
digitalWrite(dir2PinA, HIGH);
Serial.println("Motor 1 Stop");
Serial.println(" ");
break;
case '3': // Motor 1 Reverse
analogWrite(speedPinA, 255);
digitalWrite(dir1PinA, HIGH);
digitalWrite(dir2PinA, LOW);
Serial.println("Motor 1 Reverse");
Serial.println(" ");
break;
//______________Motor 2______________
case '4': // Motor 2 Forward
analogWrite(speedPinB, 255);
digitalWrite(dir1PinB, LOW);
digitalWrite(dir2PinB, HIGH);
Serial.println("Motor 2 Forward");
Serial.println(" ");
break;
case '5': // Motor 1 Stop (Freespin)
analogWrite(speedPinB, 0);
digitalWrite(dir1PinB, LOW);
digitalWrite(dir2PinB, HIGH);
Serial.println("Motor 2 Stop");
Serial.println(" ");
break;
case '6': // Motor 2 Reverse
analogWrite(speedPinB, 255);
digitalWrite(dir1PinB, HIGH);
digitalWrite(dir2PinB, LOW);
Serial.println("Motor 2 Reverse");
Serial.println(" ");
break;
default:
// turn all the connections off if an unmapped key is pressed:
for (int thisPin = 2; thisPin < 11; thisPin++) {
digitalWrite(thisPin, LOW);
}
}
}
}
หน้าที่เข้าชม | 273,446 ครั้ง |
ผู้ชมทั้งหมด | 123,965 ครั้ง |
ร้านค้าอัพเดท | 20 ต.ค. 2568 |