通过红外遥控实现步进电机的步进电机的速度及正反转
#include<reg52.h> //定义一些特殊寄存器
typedef unsigned char u8;
typedef unsigned int u16;
u8 code FFW[8]={
0x01,0x03,0x02,0x06,0x04,0x0c,0x08,0x09};//转动数组
u8 code REV[8]={
0xf9,0xf8,0xfc,0xf4,0xf6,0xf2,0xf3,0xf1};
u16 code smgduan[17]={
0,1,2,3,4};
u8 IrValue[6];
u8 Time;
u8 read;
u8 DisplayData[8];
sbit IRIN=P3^2;
sbit LSA=P2^2;
sbit LSB=P2^3;
sbit LSC=P2^4;
void delay(u16 i)
{
while(i--);
}
void

本文介绍了一种使用红外遥控器控制步进电机速度与方向的方法。通过编程实现了电机的正转、反转及停止功能,并利用红外接收器捕捉遥控指令进行相应操作。
最低0.47元/天 解锁文章
2085





