上传者: bo40137596
|
上传时间: 2019-12-21 18:48:18
|
文件大小: 4KB
|
文件类型: c
键盘控制步进电机正反转和调速c语言程序
#include //51芯片管脚定义头文件
#include //内部包含延时函数 _nop_();
#define uchar unsigned char
#define uint unsigned int
uchar code FFW[8]={0x01,0x03,0x02,0x06,0x04,0x0c,0x08,0x09};
uchar code REV[8]={0x09,0x08,0x0c,0x04,0x06,0x02,0x03,0x01};
sbit K1 = P3^5; //正转
sbit K2 = P3^3; //反转
sbit K3 = P3^5;
sbit K4 =P3^6 ;
sbit K5 =P3^7; //停止