当前位置:网站首页>A4988 and 42 stepper motors
A4988 and 42 stepper motors
2022-07-02 18:09:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
A4988 Motor drive board pin
VMOT: Power supply positive (8~35V), Supply motor GND: Motor grounding 2B,2A: Motor windings 2 Control pin 1A.1B: Motor windings 1 Control pin VDD: The power supply of the drive board is (3~5V) GND: Drive plate ENABLE: Pin low level ,A4988 Only then can the motor drive work ( Hanging is the default state , It works ), High level ,A4988 It will not be driven by the traveling motor MS1,MS2,MS3: It is used to change the driving mode, as shown in the figure REST: Low level active ,A4988 Reset the meridian line , The default is high , It works SLEEP: Low level operation and low energy consumption sleep state , It can be used with REST Connect , It will keep working normally and will not enter the state of low energy consumption . STEP: Step pin , Act according to the pulse DIR: Direction pin , low : Clockwise , high : Anti-clockwise
A46988 The voltage should be adjusted before use
voltage = Maximum current ( Motor current )X A4988 resistance X8( This case v=1.50.18=1.2) The general resistance is 0.05 o ,0.1 o ,0.2 o The potentiometer adjusts the voltage : Turn it up clockwise , Turn it down counterclockwise ( Use a multimeter to measure the potentiometer and the grounding terminal )
For this test arduino Development board
Procedure 1 : Rotate clockwise , Rotate quickly counterclockwise 2 circle
// Define constants for motor control
// A4988 Connect Arduino Pin number
const int dirPin = 2; // Direction pin
const int stepPin = 3; // Step pin
// Motor steps per revolution
const int STEPS_PER_REV = 200;
void setup() {
// Arduino control A4988 The step and direction pins are in output mode
pinMode(stepPin,OUTPUT);
pinMode(dirPin,OUTPUT);
}
void loop() {
// Set the motor to rotate clockwise
digitalWrite(dirPin,LOW);
// The motor rotates slowly
for(int x = 0; x < STEPS_PER_REV; x++) {
digitalWrite(stepPin,HIGH);
delayMicroseconds(2000); // Delay 2000 Microsecond delayMicroseconds most 16383
digitalWrite(stepPin,LOW);
delayMicroseconds(2000);
}
// Wait a second
delay(1000);
// Set the motor to rotate counterclockwise
digitalWrite(dirPin,HIGH);
// The motor rotates rapidly
for(int x = 0; x < (STEPS_PER_REV * 2); x++) {
digitalWrite(stepPin,HIGH);
delayMicroseconds(1000);
digitalWrite(stepPin,LOW);
delayMicroseconds(1000);
}
// Wait a second
delay(1000);
}
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/148253.html Link to the original text :https://javaforall.cn
边栏推荐
- 微信小程序视频分享平台系统毕业设计毕设(8)毕业设计论文模板
- MySQL --- 数据库的基本概念
- Deep understanding of ThreadLocal
- 977.有序数组的平方
- 【Golang | gRPC】使用openssl生成证书
- [golang | grpc] use grpc to realize simple remote call
- Explain kubernetes network model in detail
- 使用Zadig从0到1搭建持续交付平台
- Bluetooth technology | new working mode of wearable devices of the Internet of things, and Bluetooth ble helps the new working mode
- 【Golang | gRPC】使用gRPC实现简单远程调用
猜你喜欢
Detailed explanation of map set
详解Kubernetes网络模型
Embedded ~ introduction
MySQL安装与配置
Enter a valid user name and password in the Microsoft LDAP configuration page, and enter a valid user name in the Microsoft LDAP configuration page
微信小程序视频分享平台系统毕业设计毕设(2)小程序功能
Explain kubernetes network model in detail
Experience Alibaba cloud character recognition OCR
Does pytorch support 32 bits?
Troubleshooting ideas that can solve 80% of faults
随机推荐
What should we pay attention to in the development process of Yingguang single chip microcomputer?
Taiwan Feiling fm8pb513b MCU provides MCU program development product design
Use Zadig to build a continuous delivery platform from 0 to 1
MySQL安装与配置
qt的内存映射
MySQL -- basic concept of database
Tips for self defined packaging of Yingguang SCM 003 burner
aloam 代码阅读与总结
微信核酸检测预约小程序系统毕业设计毕设(3)后台功能
Hbuilderx runs to the mobile phone or simulator and prompts that the device is not found
NVIDIA graphics card failed to initialize nvml driver/library version mismatch error solution
515. Find the maximum value in each tree row
WPS inserts a picture and displays it completely
How to download wechat payment certificate (API certificate)
Detailed explanation of map set
Customize a loading instruction
Solution pour arrêter automatiquement les paquets Jar en cours d'exécution en éteignant le serveur de connexion xshell
Yingguang single chip microcomputer (MCU popular science)
辉芒微IO单片机FT60F010A-URT
php获取两个时间戳之间相隔多少天多少小时多少分多少秒