当前位置:网站首页>Arduino stepper library drive 28byj-48 stepper motor test program
Arduino stepper library drive 28byj-48 stepper motor test program
2022-07-01 19:58:00 【perseverance52】
Arduino Stepper Library drive 28BYJ-48 Stepper motor test procedure
- Proteus Simulation
Stepper motor 28BYJ-48 Related parameters
Stepper motor 28BYJ-48, Step angle :5.625 degree , Namely 1 A pulse signal turns 5.625 degree ,64 A signal turns 360 degree . Reduction ratio :1/64, The motor inside the motor housing turns 64 circle , The part outside the motor housing turns 1 circle .
Stepper Library description
The phase sequence of the driver of the library source code is different , To drive
28BYJ-48
Stepper motor
- Mode one : Define the way :
Stepper myStepper(motorSteps, 8,10,9,11);
- Mode two : Adjust the motor line sequence .( This example adopts the line sequence )
- Mode three : Modify the relevant code as follows :
file location :C:\Users\Administrator\Documents\Arduino\libraries\Stepper\src, Medium Stepper.cpp Source file , The first 257 That's ok -278 That's ok , Revised as follows , Is to adjust the order of high and low levels of pins .
Stepper motor related parameters
Step Angle
This parameter determines , Program runtime , Can the stepper motor rotate for one turn .
Test function description
After running the simulation , The stepping motor stops after one revolution .
Sample code
/* Arduino control 28BYJ-48 Stepper motor test procedure */
// This sample program uses Stepper library
#include <Stepper.h>// Clicking here will automatically open the management library page : http://librarymanager/All#Stepper
// The external output shaft of the motor rotates for one cycle of steps
const int stepsPerRevolution = 64;
// Create stepper motor object
// Define motor control pins and basic motor information .
// The motor control pin is 8,9,10,11
// The above pins are connected in turn ULN2803 Drive plate 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()
{
// Rotate slowly clockwise for one circle
// steppermotor.setSpeed(60);
// steppermotor.step(128);
// delay(1000);
// Rotate one circle counterclockwise quickly
// steppermotor.setSpeed(60);
// steppermotor.step(128);
// delay(2000);
}
Program source code and simulation resources
This example is based on
Proteus8.12
platform .
link :https://pan.baidu.com/s/10_t4Z3nn6_e_Twm1NHcSpw
Extraction code :up7u
Birdsong stream The Tang Dynasty · Wang wei |
---|
People idle sweet scented osmanthus fall , The night is still and the spring is empty . |
---|
The rising of the moon startles the birds , In the spring stream . |
---|
边栏推荐
- Anaconda安装虚拟环境到指定路径
- JS ternary expression complex condition judgment
- 对金额进行求和
- C # joint halcon Application - Dahua Camera Collection class
- Example explanation: move graph explorer to jupyterlab
- 基于图的 Affinity Propagation 聚类计算公式详解和代码示例
- Using win7 vulnerability to crack the system login password
- Linux下安装Redis,并配置环境
- uniapp使用腾讯地图选点 没有window监听回传用户的位置信息,怎么处理
- Test self-study people must see: how to find test items in software testing?
猜你喜欢
Related concepts of cookies and sessions
Easycvr accesses the equipment through the national standard gb28181 protocol. What is the reason for the automatic streaming of the equipment?
Redis installation and startup in Windows environment (background startup)
[untitled]
面试题篇一
类加载机制
Class loading mechanism
Modsim basic use (Modbus simulator)
有意思了!数据库也搞Serverless!
Bind this of the current scope for callback functions in other cases such as timers and delayers
随机推荐
Arduino Stepper库驱动28BYJ-48步进电机测试程序
Easycvr accesses the equipment through the national standard gb28181 protocol. What is the reason for the automatic streaming of the equipment?
#yyds干货盘点#SQL聚合查询方法总结
list分割成满足和不满足条件的集合(partitioningBy)
开发那些事儿:EasyCVR集群设备管理页面功能展示优化
【多线程】 实现单例模式 ( 饿汉、懒汉 ) 实现线程安全的单例模式 (双重效验锁)
自定义插入页面标签以及实现类似通讯录的首字母搜索
Regular expression =regex=regular expression
switch 有四样写法你知道么
Unreal Engine packaging project
STC 32位8051单片机开发实例教程 三 程序编译设置与下载
墨天轮沙龙 | 清华乔嘉林:Apache IoTDB,源于清华,建设开源生态之路
SwiftUI 4 新功能大全之 Toggle与 Mixed Toggle 多个绑定组件
2022/5/23-2022/5/30
How can a programmer grow rapidly
Using win7 vulnerability to crack the system login password
Interview questions shared in today's group
Oracle 死锁测试
Test self-study people must see: how to find test items in software testing?
2022/6/8-2022/6/12