单片机控制步进电机要求:有加速、减速、停止、正转、反转按钮,电机是四...答:我用的是控制一个步进电机的,这个是我以前写的,你的要求在下面的程序做修改就行了;程序如下:include <reg52.h> define uchar unsigned char define uint unsigned int //uchar table[]={0x18,0x30,0x60,0x48,0x48,0x60,0x30,0x18}; //二相励磁 uchar table[]={0x08,0x10,0x20,0x...
求利用51单片机实现控制步进电机(PWM电机)前进、后退、加减速 的程序...答:sbit F1 = P1^0;sbit F2 = P1^1;sbit F3 = P1^2;sbit F4 = P1^3;unsigned char code FFW[8]={0xfe,0xfc,0xfd,0xf9,0xfb,0xf3,0xf7,0xf6}; //反转 unsigned char code FFZ[8]={0xf6,0xf7,0xf3,0xfb,0xf9,0xfd,0xfc,0xfe}; //正转 unsigned int K;/ 步进电机驱动...
用C51单片机,编写脉冲控制步进电机的驱动器答:Time0() interrupt 1//T0中断服务(显示扫描、步进驱动){ static uchar pot[4] = {0x01,0x02,0x04,0x08};//LED位置输出数据 static uchar i = 0;//扫描位置 static uchar rht[8] = {0x01,0x03,0x02,0x06,//步进电机节拍表 0x04,0x0c,0x08,0x09};static uchar rhi = 0;//节拍...