当前位置:网站首页>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 . |
---|
边栏推荐
- How to use console Log print text?
- Test self-study people must see: how to find test items in software testing?
- ModSim基本使用(Modbus模拟器)
- 一文读懂C语言中的结构体
- [AI server setup] CUDA environment
- STC 32位8051单片机开发实例教程 三 程序编译设置与下载
- Solve the problem of slow or failed vscode download
- GC garbage collection
- 【多线程】锁策略
- list分割成满足和不满足条件的集合(partitioningBy)
猜你喜欢
独家消息:阿里云悄然推出RPA云电脑,已与多家RPA厂商开放合作
【AI服务器搭建】CUDA环境
Oracle physical architecture
windows环境 redis安装和启动(后台启动)
3D全景模型展示可视化技术演示
Detailed configuration of network security "Splunk" in national vocational college skills competition
开发那些事儿:EasyCVR集群设备管理页面功能展示优化
Graduation season | Huawei experts teach the interview secret: how to get a high paying offer from a large factory?
使用Zadig从0到1搭建持续交付平台
fastDFS入门
随机推荐
docker ubuntu容器中安装mysql遇到的问题
Servlet knowledge points
Linux下安装Redis,并配置环境
C#联合halcon应用——大华相机采集类
How to prevent repeated submission of new orders
GC垃圾回收
SwiftUI 4 新功能大全之 Toggle与 Mixed Toggle 多个绑定组件
MySQL reports an error can't create table 'demo01 tb_ Student‘ (errno: 150)*
强大、好用、适合程序员/软件开发者的专业编辑器/笔记软件综合评测和全面推荐
2022/6/8-2022/6/12
上大学后明白了哪些坑人的事?
Technology T3 domestic platform! Successfully equipped with "Yihui domestic real-time system sylixos"
Difference between redo and undo
DS transunet: Dual Swing transformer u-net for medical image segmentation
Image acquisition and playback of coaxpress high speed camera based on pxie interface
Mysql查询结果去除换行
STC 32位8051单片机开发实例教程 二 I/O工作模式及其配置
振弦采集模塊測量振弦傳感器的流程步驟
P2433 【深基1-2】小学数学 N 合一
Redis installation and startup in Windows environment (background startup)