89c52串口调试控制步进电机的运行单步运行该怎么做?

还没有帐号? 赶紧
用户版块帖子
请教:谁有STC12C2052控制步进电机的程序
UID:1448035
在线时间58小时
M币134专家1
有哪位好心人有STC12C2052控制二相步进电机的程序?
UID:891572
在线时间383小时
M币818专家1
/*----------------------------------------------------&&&&名称:两相步进电机控制程序&&&&单片机:stc12c2052&&&&晶振:12M&&&&按键:四个按键分别接P3的0,1,2,3端口&&&&输出:P1的0,1,2,3端口,4拍方式运转&&&&内容:用四个按键控制步进电机启停,正反转和速度加减&&&&注意:当碰到电机振动而不转动时,可把中断时间调长些或&&&&&&&&&&&&改变速度调节变量的初始值降低速度------------------------------------------------------*/#include&reg52.h&&&&&&&&&//头文件#define KeyPort P3&&&&//定义P3为键盘端口sbit A1=P1^0;&&&&//定义A线圈正端口sbit A2=P1^1;&&&&//定义A线圈负端口sbit B1=P1^2;&&&&//定义B线圈正端口sbit B2=P1^3;&&&&//定义B线圈负端口#define Coil_A1&& {A1=0;A2=1;B1=1;B2=1;}&&//A线圈通正向电压#define Coil_B1&& {A1=1;A2=1;B1=0;B2=1;}&&&&//B线圈通正向电压#define Coil_A2&& {A1=1;A2=0;B1=1;B2=1;}&&//A线圈通反向电压#define Coil_B2&& {A1=1;A2=1;B1=1;B2=0;}&&&&//B线圈通反向电压#define Coil_OFF&&{A1=1;A2=1;B1=1;B2=1;}&&//全部断电 unsigned char Speed=1;&&&&//速度调节变量unsigned int b=5000;&&&&//中断初值变量bit Flag1;&&&&//启停标志位bit Flag2;&&&&//正反转标志位void DelayMs (unsigned int a)&&&&//大致1ms延时{&&&&&&&&&&&&&&&&//无符号整型局部变量&&&&while(a--!=0)&&&&&&&&&&&&&&&&{&&&&&&&&for(i=0;i&600;i++);&&&&&&&&}}unsigned char KeyScan(void)//按键扫描函数,返回扫描键值{&&&&unsigned char K&&&&//无符号字符型变量&&&&if(KeyPort!=0xff)&&&&&&&&&&&&//判断P3口是否有按键按下&&&&{&&&&&&&&DelayMs(10);&&&&&&&&&&&&//按键去抖&&&&&&&&if(KeyPort!=0xff)&&&&&&&&//再次判断&&&&&&&&{&&&&&&&&&&&&Keyvalue=KeyP&&&&&&&&//赋值&&&&&&&&&&&&while(KeyPort!=0xff);//等待按键松开&&&&&&&&&&&&switch(Keyvalue)&&&&&&&&//读取按键,提取返回值&&&&&&&&&&&&{&&&&&&&&&&&&&&&&case 0xfe:return 1;&&&&//第一个键按下,返回1&&&&&&&&&&&&&&&&case 0xfd:return 2;&&&&//第二个键按下,返回2&&&&&&&&&&&&&&&&case 0xfb:return 3;&&&&//第三个键按下,返回3&&&&&&&&&&&&&&&&case 0xf7:return 4;&&&&//第四个键按下,返回4&&&&&&&&&&&&&&&&default:return 0;&&&&&&&&//条件不符合,返回0&&&&&&&&&&&&}&&&&&&&&}&&&&&&&&}&&&&return 0;&&&&//没按键按下返回0&&&&}void Init_Timer0(void)&&&&//初始化定时器0{&&&&TMOD=0x01;&&&&&&&&&&&&&&&&//定时器0,使用模式1,16位定时器&&&&TH0=(65536-b)/256;&&&&//给定初值&&&&TL0=(65536-b)%256;&&&&EA=1;&&&&&&&&//打开总中断&&&&ET0=1;&&&&//打开定时器中断&&&&TR0=1;&&&&//开定时器}void main()&&&&//主函数{&&&&&&&&//无符号整型变量&&&&Init_Timer0();&&&&&&&&//初始化定时器0&&&&Coil_OFF&&&&&&&&&&&&&&&&//全部断电&&&&while(1)&&&&&&&&&&&&&&&&//大循环&&&&{&&&&&&&&num=KeyScan();&&&&//循环调用按键扫描&&&&&&&&if(num==1)&&&&&&&&//启停按键&&&&&&&&&&&&Flag1=!Flag1;&&&&//取反&&&&&&&&else&&&&if(num==2)&&&&//正反转按键&&&&&&&&&&&&&&&&&&&&Flag2=!Flag2;&&&&&&&&//取反&&&&&&&&&&&&&&&&else if(num==3)&&&&&&&&//减速按键&&&&&&&&&&&&&&&&&&&&&&{&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&if(Speed&10)&&&&//判断速度调节变量的值&&&&&&&&&&&&&&&&&&&&&&&&&&&&{&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&Speed++;&&&&&&&&//变量自加1,数值越大速度越慢&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&b+=100;&&&&&&&&//每次速度等级加1中断时间加,一是为了低速调节时速度等级更明显,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&}&&&&&&&&&&&&&&&&&&&&//二是增加了速度调节范围&&&&&&&&&&&&&&&&&&&&&&}&&&&&&&&&&&&&&&&&&&&&&else if(num==4)&&&&&&&&//加速按键&&&&&&&&&&&&&&&&&&&&&&&&&&&& {&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& if(Speed&1)//判断速度调节变量的值&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& {&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&Speed--;&&&&//变量自减1&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& b-=100;&&&&//每次速度等级减1中断时间减&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& }&&&&&&&&&&&&&&&&&&&&&&&&&&&& }&&&&&&&&&&&&&&&&&&&&&&&&&&&&}}void Timer0_isr(void) interrupt 1&&&&//定时器中断子程序{&&&&static unsigned char times,i;&&&&&&&&//静态局部变量&&&&TH0=(65536-b)/256;&&&&//重新赋值 &&&&TL0=(65536-b)%256;&&&&if(Flag1==0)&&&&&&&&&&&&//停转标志&&&&&&&&Coil_OFF&&&&&&&&&&&&&&&&//全部断电&&&&else if(Flag1==1)&&&&&&&&//启动标志&&&&&&&&&&&&{&&&&&&&&&&&&&&&&if(times&Speed)&&&&//防止调节加速按键时Speed&times &&&&&&&&&&&&&&&&&&&&times=0;&&&&&&&&&&&&//中断次数置0,重计中断次数&&&&&&&&&&&&&&&&else if(times==Speed)&&&&//中断次数与速度变量相等&&&&&&&&&&&&&&&&&&&&&&&&{&&&&&&&&&&&&&&&&&&&&&&&&&&&&times=0;&&&&&&&&&&&&//中断次数置0,重计中断次数&&&&&&&&&&&&&&&&&&&&&&&&&&&&if(Flag2==1)&&&&//正转标志&&&&&&&&&&&&&&&&&&&&&&&&&&&&{&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&switch(i)&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&{&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&case 0:Coil_A1;i++;&&&&//通电次序:+A,+B,-A,-B&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&case 1:Coil_B1;i++;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&case 2:Coil_A2;i++;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&case 3:Coil_B2;i=0;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&default:&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&}&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&}&&&&&&&&&&&&&&&&&&&&&&&&&&&&else if(Flag2==0)&&&&&&&&//反转&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&{&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&switch(i)&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&{&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&case 0:Coil_B1;i=3;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&case 1:Coil_A2;i--;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&case 2:Coil_B2;i--;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&case 3:Coil_A1;i--;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&default:&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&}&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&}&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&}&&&&&&&&&&&&&&&&&&&&&&&&else times++;&&&&//每次中断加1&&&&&&&&&&&&}}
UID:1072941
在线时间220小时
M币530专家3
&&&& 我也在写两相四线步进电机的驱动
UID:1002883
在线时间1371小时
M币3146专家1
虽然不会,但学学有好处。
UID:1448035
在线时间58小时
M币134专家1
回 林帅哥 的帖子
:/*----------------------------------------------------&&&&名称:两相步进电机控制程序&&&&单片机:stc12c2052&&&&晶振:12M&&&&按键:四个按键分别接P3的0,1,2,3端口.......&( 18:14)&我这里有一个最简单的程序,在STC89C52RC上可以上电就运转,但是在STC12C2052上,电机只是摆动、不转。二相端口用的是P1.7/1.6/1.5/1.4以下是程序,麻烦看看哪个地方有问题? #include &reg52.h&unsigned char code F_Rotation[8]={0x80,0xc0,0x40,0x60,0x20,0x30,0x10,0x90};&& //正转表格 半步方式&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& //--------------------------------------------------------------------//延时函数,延时时间由cnt决定//--------------------------------------------------------------------void delay(unsigned long cnt){&&&&while(cnt--);}main(){ &&&& while(1)&& {&&&&&& P1 = F_Rotation;&&&&&& i++;&&&&&& if(i & 7)i=0;&&&&&& delay(3000);&& }}
UID:1448035
在线时间58小时
M币134专家1
回 林帅哥 的帖子
:/*----------------------------------------------------&&&&名称:两相步进电机控制程序&&&&单片机:stc12c2052&&&&晶振:12M&&&&按键:四个按键分别接P3的0,1,2,3端口.......&( 18:14)&另外,再请教一下,我的板子是2051系列最小系统板的,没有外部上拉电阻,是不是需要加上上拉电阻?
UID:806169
在线时间1136小时
M币3269专家11
仅仅让步进电机转没有多大意义,实际使用时都是需要精确控制脉冲数量的.
UID:1448035
在线时间58小时
M币134专家1
回 林帅哥 的帖子
:/*----------------------------------------------------&&&&名称:两相步进电机控制程序&&&&单片机:stc12c2052&&&&晶振:12M&&&&按键:四个按键分别接P3的0,1,2,3端口....... 将你的程序拷贝在KEIL运行,出现这样问题,是不是头文件需要修改?
本文内容包含图片或附件,获取更多资讯,请
后查看;或者
成为会员获得更多权限
访问内容超出本站范围,不能确定是否安全
如果您提交过一次失败了,可以用”恢复数据”来恢复帖子内容
您目前还是游客,请
&回复后跳转到最后一页
Code by , Time now is:09-22 08:41, Total 0.130818(s) query 7,
Gzip enabled&STC89C52单片机步进电机调试
> STC89C52单片机步进电机调试
STC89C52单片机步进电机调试
///////////////////////////////////////////////////////////////////////////实现功能: 先让实验板上的步进电机从正向加速&&匀速&&减速,然后让步进电机 停止,再让步进电机从方向加速&&匀速&&减速,然后停止,然后就这 样不停的循环实验板型号:BS-XYD-C52实验名称:步进电机测试实验编写人: 谢应东编写日期: ///////////////////////////////////////////////////////////////////////////#include本文引用地址:#define uchar unsigned char#define uint unsigned int#define MotorData P2 //步进电机控制接口定义uchar code Phase_Forward[4]={0xf8,0xf4,0xf2,0xf1};//正转 电机导通相序 D-C-B-Auchar code Phase_Reverse[4]={0xf1,0xf2,0xf4,0xf8};//反转 电机导通相序 A-B-C-D///////////////////////////////////////////////////////////////////////////函数名称:毫秒延时函数函数功能:实现毫秒级的延时参数介绍:Delay_MS: 定义需要延时的毫秒的数值 iNumber: 记录Delay_MS的数值,以for语句实现所要求的延时 iValue: 要延时毫秒所要进行的循环数值,本数值为实际测得返回值: 无注意事项:本实验是在所用晶振为12M的前提下实现的毫秒延时,本函数是通过循环的形 式完成,所以如果改变了晶振的频率,请做相应的改变///////////////////////////////////////////////////////////////////////////void DelayMs(uint Delay_MS){uint iNumber,iVfor(iNumber=0;iNumber<Delay_MS;iNumber++){ iValue=107; while(iValue--);}}///////////////////////////////////////////////////////////////////////////函数名称:Motor_Forward函数功能:完成步进电机的正向加速&&匀速&&减速的功能参数介绍:无返回值: 无注意事项:无///////////////////////////////////////////////////////////////////////////void Motor_Forward(void){ uint cNumber,cTempV speed=25; //定义步进电机加速的初值 cTempValue=1000; //定义正向加速后匀速的时间 do{ for(cNumber=0;cNumber<4;cNumber++) //驱动步进电机正向转动 { MotorData=Phase_Forward[cNumber]; DelayMs(speed);//调整步进电机的速度 } speed--; //正向加速}while(speed!=3); do//驱动步进电机匀速转动 {
for(cNumber=0;cNumber<4;cNumber++) { MotorData=Phase_Forward[cNumber]; DelayMs(speed); } cTempValue--; }while(cTempValue!=1); do //驱动步进电机反向转动 { for(cNumber=0;cNumber<4;cNumber++) { MotorData=Phase_Forward[cNumber]; DelayMs(speed); } speed++; //调整步进电机的速度 }while(speed!=25);}///////////////////////////////////////////////////////////////////////////函数名称:Motor_Reverse函数功能:完成步进电机的方向加速&&匀速&&减速的功能参数介绍:无返回值: 无注意事项:无///////////////////////////////////////////////////////////////////////////void Motor_Reverse(void){ uint cNumber,cTempV speed=25; //定义步进电机加速的初始值 cTempValue=1000; //定义步进电机匀速的时间 do //完成步进的电机的方向加速{ for(cNumber=0;cNumber<4;cNumber++) //驱动步进电机 { MotorData=Phase_Reverse[cNumber]; DelayMs(speed); //调整步进电机的速度 } speed--;}while(speed!=3); do //完成步进电机的匀速过程 {
for(cNumber=0;cNumber<4;cNumber++) { MotorData=Phase_Reverse[cNumber]; DelayMs(speed); } cTempValue--; }while(cTempValue!=1); do //完成步进电机的反向减速过程 { for(cNumber=0;cNumber<4;cNumber++) { MotorData=Phase_Reverse[cNumber]; DelayMs(speed); //调整步进电机的速度 } speed++; }while(speed!=25);}///////////////////////////////////////////////////////////////////////////函数名称:MotorStop函数功能:让步进电机停止转动,然后再延时0.5秒参数介绍:无返回值: 无注意事项:无///////////////////////////////////////////////////////////////////////////void Motor_Stop(void){MotorData=0xf0;DelayMs(500);}///////////////////////////////////////////////////////////////////////////函数名称:主函数函数功能:完成点亮一个发光二级管,延时0.3秒,然后熄灭0.3秒,这样依次循环参数介绍:无返回值: 无注意事项:无///////////////////////////////////////////////////////////////////////////void main(void){DelayMs(50);//等待系统稳定while(1){Motor_Forward();//步进电机正向加速&&匀速&&减速的函数Motor_Stop(); //步进电机停止转动Motor_Reverse();//步进电机反向加速&&匀速&&减速的函数Motor_Stop();//步进电机停止转动}}
分享给小伙伴们:
我来说两句……
最新技术贴
微信公众号二
微信公众号一查看: 244|回复: 4
stc89c52单片机控制5v步进电机转一周然后延时两三秒在转一周依次循环
主题帖子积分
新手上路, 积分 13, 距离下一级还需 37 积分
在电机这里转一周延时两三秒写得对吗& &还有延时程序写那种好点,我是直接用的电机调节转速的延时函数,求大侠帮帮忙
void&&Motor()
& & & & while(1)
& & & & & & & & for(i=0;i&8;i++);
& & & & & & & & Delay(200);
& & & & & & & & {
& & & & & & & & & & & & GPIO_MOTOR = FFW[i]&0x1f;&&//取数据
& & & & & & & & & & & & Delay(1);& & & & //调节转速& & & &
& & & & & & & & }
主题帖子积分
你这个程序,让步进电机转动起来才怪。
好好看看例程吧。/*******************************************************************************
* 实 验 名& & & & & & & &&&: 步进电机实验
* 使用的IO& & & && && &: 电机用P1口,键盘使用P3.0、P3.1、P3.2、P3.3
* 实验效果& && & : 按下K1键,顺时针转,按下K2键,逆时针转,按下K3键,低速,
*按下K4键,高速。
* 注& & 意& & & & & & & &&&:由于P3.2口跟红外线共用,所以做按键实验时为了不让红外线影响实验
*效果,最好把红外线先取下来。
*******************************************************************************/
#include &reg52.h&
#define GPIO_MOTOR P1
//sbit F1 = P1^0;
//sbit F2 = P1^1;
//sbit F3 = P1^2;
//sbit F4 = P1^3;
sbit K1=P3^0;
sbit K2=P3^1;
sbit K3=P3^2;
sbit K4=P3^3;
unsigned char code FFW[8]={0xf1,0xf3,0xf2,0xf6,0xf4,0xfc,0xf8,0xf9}; //反转顺序
unsigned char code FFZ[8]={0xf9,0xf8,0xfc,0xf4,0xf6,0xf2,0xf3,0xf1}; //正转顺序
unsigned char Direction,S
void Delay(unsigned int t);
void&&Motor();
/*******************************************************************************
* 函 数 名& && & : main
* 函数功能& & & & & & & &&&: 主函数
* 输& & 入& && & : 无
* 输& & 出& && & : 无
*******************************************************************************/
void main(void)
& & & & Speed=30;
&&while(1)
& & & & & & & & if(K1==0)& & & & & & & & //检测按键K1是否按下
& & & & & & & & {
& & & & & & & & & & & & Delay(1);& & & & //消除抖动
& & & & & & & & & & & & if(K1==0)
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & Direction=1;
& & & & & & & & & & & & }
& & & & & & & & & & & & while((i&200)&&(K1==0))& & & &&&//检测按键是否松开
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & Delay(1);
& & & & & & & & & & & & & & & & i++;
& & & & & & & & & & & & }
& & & & & & & & & & & & i=0;
& & & & & & & & }
& & & & & & & & if(K2==0)& & & & & & & & //检测按键K1是否按下
& & & & & & & & {
& & & & & & & & & & & & Delay(1);& & & & //消除抖动
& & & & & & & & & & & & if(K2==0)
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & Direction=2;
& & & & & & & & & & & & }
& & & & & & & & & & & & while((i&200)&&(K2==0))& & & &&&//检测按键是否松开
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & Delay(1);
& & & & & & & & & & & & & & & & i++;
& & & & & & & & & & & & }
& & & & & & & & & & & & i=0;
& & & & & & & & }& & & & & & & & & & & &
& & & & & & & & if(K3==0)& & & & & & & & //检测按键K1是否按下
& & & & & & & & {
& & & & & & & & & & & & Delay(1);& & & & //消除抖动
& & & & & & & & & & & & if(K3==0)
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & Speed=13;
& & & & & & & & & & & & }
& & & & & & & & & & & & while((i&200)&&(K3==0))& & & &&&//检测按键是否松开
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & Delay(1);
& & & & & & & & & & & & & & & & i++;
& & & & & & & & & & & & }
& & & & & & & & & & & & i=0;
& & & & & & & & }
& & & & & & & & if(K4==0)& & & & & & & & //检测按键K1是否按下
& & & & & & & & {
& & & & & & & & & & & & Delay(1);& & & & //消除抖动
& & & & & & & & & & & & if(K4==0)
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & Speed=40;
& & & & & & & & & & & & }
& & & & & & & & & & & & while((i&200)&&(K4==0))& & & &&&//检测按键是否松开
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & Delay(1);
& & & & & & & & & & & & & & & & i++;
& & & & & & & & & & & & }
& & & & & & & & & & & & i=0;
& & & & & & & & }& & & & & & & &
& & & & & & & & Motor();
/*******************************************************************************
* 函 数 名& && && &: Motor
* 函数功能& & & & & & & && & : 电机旋转函数
* 输& & 入& && && &: 无
* 输& & 出& && && &: 无
*******************************************************************************/
void&&Motor()
& & & & for(i=0;i&8;i++)
& & & & & & & & if(Direction==1)
& & & & & & & & & & & & GPIO_MOTOR = FFW[i]&0x1f;&&//取数据
& & & & & & & & if(Direction==2)
& & & & & & & & & & & & GPIO_MOTOR = FFZ[i]&0x1f;
& & & & & & & & Delay(Speed);& & & & //调节转速& & & &
& & & & }& & & && && && && && && &
/*******************************************************************************
* 函 数 名& && && &: Delay
* 函数功能& & & & & & & && & : 延时
* 输& & 入& && && &: t
* 输& & 出& && && &: 无
*******************************************************************************/
void Delay(unsigned int t)
{& && && && && && && && && &
& & & & while(t--)
& & & & & & & & for(k=0; k&80; k++)
& & & & & & & & { }
主题帖子积分
你这个程序,让步进电机转动起来才怪。
好好看看例程吧。/********************************************* ...
#include &reg52.h&
#define GPIO_MOTOR P1
//sbit F1 = P1^0;
//sbit F2 = P1^1;
//sbit F3 = P1^2;
//sbit F4 = P1^3;
unsigned char code FFZ[8]={0xf9,0xf8,0xfc,0xf4,0xf6,0xf2,0xf3,0xf1}; //正转顺序
unsigned char Direction,S
void Delay(unsigned int t);
void&&Motor();
void main(void)
& & & & Speed=1;
& & & & while(1)
& & & & {& & & &
& & & & & & & & Direction=1;
& & & & & & & & Speed=1;
& & & & & & & & Delay(300);
void Motor()
& & & & for(i=0;i&8;i++)
& & & & & & & & if(Direction==1)
& & & & & & & & & & & & GPIO_MOTOR = FFZ&0x1f;
& & & & & & & & Delay(Speed);
void Delay(unsigned int t)
& & & & while(t--)
& & & & & & & & for(k=0;k&80;k++)
& & & & & & & & { }
大侠&&在帮我看看诶& &编译时有个警告&&这样编写能不能实现我想要的功能
主题帖子积分
#include &reg52.h&
我才学&&不是很懂额
主题帖子积分
我才学&&不是很懂额
你的程序,肯定不能完成你的设想。因为你不知道步进电机的一些基本参数。
如图所示,有一个叫步距角的参数,是说给一次脉冲,电机转动的角度。没有这个参数,你是不能控制转多少角度的。
再给你一份资料,好好学习吧。
本帖子中包含更多资源
才可以下载或查看,没有帐号?
Powered by君,已阅读到文档的结尾了呢~~
基于STC89C52单片机的步进电机控制系统设计控制,系统,设计,步进电机,基于单片机
扫扫二维码,随身浏览文档
手机或平板扫扫即可继续访问
基于STC89C52单片机的步进电机控制系统设计
举报该文档为侵权文档。
举报该文档含有违规或不良信息。
反馈该文档无法正常浏览。
举报该文档为重复文档。
推荐理由:
将文档分享至:
分享完整地址
文档地址:
粘贴到BBS或博客
flash地址:
支持嵌入FLASH地址的网站使用
html代码:
&embed src='/DocinViewer-4.swf' width='100%' height='600' type=application/x-shockwave-flash ALLOWFULLSCREEN='true' ALLOWSCRIPTACCESS='always'&&/embed&
450px*300px480px*400px650px*490px
支持嵌入HTML代码的网站使用
您的内容已经提交成功
您所提交的内容需要审核后才能发布,请您等待!
3秒自动关闭窗口未能加载文件或程序集“TradeSite.Website”或它的某一个依赖项。磁盘空间不足。 (异常来自 HRESULT:0x)
“/”应用程序中的服务器错误。
未能加载文件或程序集“TradeSite.Website”或它的某一个依赖项。磁盘空间不足。 (异常来自 HRESULT:0x)
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.IO.FileLoadException: 未能加载文件或程序集“TradeSite.Website”或它的某一个依赖项。磁盘空间不足。 (异常来自 HRESULT:0x)
执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。
程序集加载跟踪: 下列信息有助于确定程序集“TradeSite.Website”无法加载的原因。
警告: 程序集绑定日志记录被关闭。
要启用程序集绑定失败日志记录,请将注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD)设置为 1。
注意: 会有一些与程序集绑定失败日志记录关联的性能损失。
要关闭此功能,请移除注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog]。
[FileLoadException: 未能加载文件或程序集“TradeSite.Website”或它的某一个依赖项。磁盘空间不足。 (异常来自 HRESULT:0x)]
System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142
System.Reflection.Assembly.Load(String assemblyString) +28
System.pilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46
[ConfigurationErrorsException: 未能加载文件或程序集“TradeSite.Website”或它的某一个依赖项。磁盘空间不足。 (异常来自 HRESULT:0x)]
System.pilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +613
System.pilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203
System.pilationSection.LoadAssembly(AssemblyInfo ai) +105
pilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
pilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +54
pileWebFile(VirtualPath virtualPath) +229
pilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +261
pilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +101
pilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +83
System.Web.UI.PageParser.GetCompiledPageInstance(VirtualPath virtualPath, String inputFile, HttpContext context) +224
System.Web.UI.PageParser.GetCompiledPageInstance(String virtualPath, String inputFile, HttpContext context) +121
URLRewriter.RewriterFactoryHandler.GetHandler(HttpContext context, String requestType, String url, String pathTranslated) +723
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +193
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +93
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
版本信息:&Microsoft .NET Framework 版本:2.0.; ASP.NET 版本:2.0.

我要回帖

更多关于 kh01步进电机控制器 的文章

 

随机推荐