当前位置:网站首页>Arduino Stepper库驱动28BYJ-48步进电机测试程序
Arduino Stepper库驱动28BYJ-48步进电机测试程序
2022-07-01 18:47:00 【perseverance52】
Arduino Stepper库驱动28BYJ-48步进电机测试程序
- Proteus仿真

步进电机28BYJ-48相关参数
步进电机28BYJ-48,步进角:5.625度,就是1个脉冲信号转5.625度,64个信号转360度。减速比:1/64,电机壳里边的电机转64圈,电机壳外边的部分转1圈。
Stepper库说明
库源代码的驱动的相序是不一样的,为了驱动
28BYJ-48步进电机
- 方式一:定义方式:
Stepper myStepper(motorSteps, 8,10,9,11); - 方式二:对调电机电机线序。(本例采用对调线序)
- 方式三: 修改相关代码如下:
文件位置:C:\Users\Administrator\Documents\Arduino\libraries\Stepper\src,中的Stepper.cpp源文件,第257行-278行,修改如下,就是调整引脚高低电平顺序。

步进电机相关参数
Step Angle该参数决定了,程序运行时,步进电机能否转一圈。

测试功能说明
运行仿真后,步进电机转一圈停止。
示例代码
/* Arduino控制28BYJ-48步进电机测试程序 */
//本示例程序使用Stepper库
#include <Stepper.h>//点击这里会自动打开管理库页面: http://librarymanager/All#Stepper
// 电机外部输出轴旋转一周步数
const int stepsPerRevolution = 64;
// 建立步进电机对象
// 定义电机控制引脚以及电机基本信息。
// 电机控制引脚为 8,9,10,11
// 以上引脚依次连接在ULN2803 驱动板 In1, In2, In3, In4
Stepper steppermotor(stepsPerRevolution, 8, 9, 10, 11);
void setup()
{
Serial.begin(9600);
// set the speed at 60 rpm:
delay(1000);
Serial.println("Start...");
steppermotor.setSpeed(60);
steppermotor.step(128);
Serial.println("Stop...");
delay(1000);
}
void loop()
{
// 慢速顺时针旋转一圈
// steppermotor.setSpeed(60);
// steppermotor.step(128);
// delay(1000);
// 快速逆时针旋转一圈
// steppermotor.setSpeed(60);
// steppermotor.step(128);
// delay(2000);
}
程序源码和仿真资源
本示例基于
Proteus8.12平台。
链接:https://pan.baidu.com/s/10_t4Z3nn6_e_Twm1NHcSpw
提取码:up7u
| 鸟鸣涧 唐朝·王维 |
|---|
| 人闲桂花落,夜静春山空。 |
|---|
| 月出惊山鸟,时鸣春涧中。 |
|---|
边栏推荐
- [SQL optimization] the difference between with as and temporary tables
- GC垃圾回收
- [research data] observation on the differences of health preservation concepts among people in 2022 - Download attached
- The large list set is divided into multiple small list sets in equal proportion
- Servlet knowledge points
- 开发那些事儿:EasyCVR集群设备管理页面功能展示优化
- Graduation season | Huawei experts teach the interview secret: how to get a high paying offer from a large factory?
- 为定时器和延时器等其它情况的回调函数绑定当前作用域的this
- Solve the problem of slow or failed vscode download
- MYSLQ十种锁,一篇文章带你全解析
猜你喜欢

Regular expression =regex=regular expression
![Leetcode 1380 lucky numbers in matrix [array] the leetcode path of heroding](/img/56/0c7f39406814b5bf92eca5f6670e10.jpg)
Leetcode 1380 lucky numbers in matrix [array] the leetcode path of heroding

Procédure de mesure du capteur d'accord vibrant par le module d'acquisition d'accord vibrant

Optimization of video streaming with repeated requests in the case of unstable easygbs network

Cookie和Session的相关概念

Use of common built-in classes of JS

Axure does not display catalogs

Test self-study people must see: how to find test items in software testing?

Why has instagram changed from a content sharing platform to a marketing tool? How do independent sellers use this tool?

Redis installation and startup in Windows environment (background startup)
随机推荐
对象的创建
STC 32位8051单片机开发实例教程 二 I/O工作模式及其配置
Using win7 vulnerability to crack the system login password
Proxy in ES6
集合对象值改变NULL值对象
Easycvr accesses the equipment through the national standard gb28181 protocol. What is the reason for the automatic streaming of the equipment?
Interview question 1
Test self-study people must see: how to find test items in software testing?
JVM内存模型
Gaussdb (for MySQL):partial result cache, which accelerates the operator by caching intermediate results
Difference between redo and undo
Example explanation: move graph explorer to jupyterlab
Actual combat of flutter - fast implementation of audio and video call application
【AI服务器搭建】CUDA环境
Oracle物理体系结构
Wireshark packet analysis TCP, FTP
qobject_cast用法
[AI server setup] CUDA environment
Bao, what if the O & M 100+ server is a headache? Use Xingyun housekeeper!
Linux下安装Redis,并配置环境