motor.zip
大小:137.27KB
价格:35积分
下载量:0
评分:
5.0
上传者:qq_63306197
更新日期:2025-09-22

51单片机控制三个步进电机的启动停止加protrus仿真

资源文件列表(大概)

文件名
大小
Motor/
-
Motor/Listings/
-
Motor/Listings/main.lst
5.11KB
Motor/Listings/motor.m51
7.36KB
Motor/Listings/STARTUP.lst
13.82KB
Motor/main.c
2.57KB
Motor/motor.uvgui.er_ji
69.63KB
Motor/motor.uvopt
5.26KB
Motor/motor.uvproj
13.7KB
Motor/Objects/
-
Motor/Objects/main.obj
4.88KB
Motor/Objects/motor
4.95KB
Motor/Objects/motor.build_log.htm
976B
Motor/Objects/motor.hex
1.04KB
Motor/Objects/motor.lnp
101B
Motor/Objects/STARTUP.obj
819B
Motor/STARTUP.A51
6.23KB
protrus/
-
protrus/Project Backups/
-
protrus/Project Backups/新工程 [20241029, 23-03-53].pdsprj
10.29KB
protrus/Project Backups/新工程 [20241029, 23-03-54].pdsprj
20.17KB
protrus/Project Backups/新工程 [20241029, 23-10-25].pdsprj
20.18KB
protrus/Project Backups/新工程 [20241029, 23-10-26].pdsprj
20.18KB
protrus/Project Backups/新工程 [Autosaved].pdsprj
20.2KB
protrus/新工程.pdsprj
20.18KB
protrus/新工程.pdsprj.DESKTOP-N42O05I.er_ji.workspace
2.15KB

资源内容介绍

51单片机控制三个步进电机的启动停止加protrus仿真
#include<reg51.h>#define uchar unsigned char#define uint unsigned int#define OUT1 P1#define OUT2 P2 #define OUT3 P3sbit key0 = P0^1; sbit key1 = P0^0; sbit key2 = P0^2; sbit key3 = P0^3; sbit key4 = P0^4; sbit key5 = P0^5; //void delay(uint);uint TIME,TIME1,TIME2; uchar code turn[] = {0x02,0x06,0x04,0x0c,0x08,0x09,0x01,0x03}; void main(){ uchar a,b,c; OUT1 = 0x03; OUT2 = 0x03; OUT3 = 0x03; TMOD = 0x01; TH0 = 0x3c; TL0 = 0xb0; EA = 1; ET0 = 1; TR0 = 1; while(1) { if (key0&&key1) TIME=0; if (!key0) { if (TIME==2) { a = a<8?a+1:0; OUT1 = turn[a]; TIME = 0; } } if (!key1) { if (TIME==2) { a = a>0?a-1:7; OUT1 = turn[a]; TIME = 0; } } if (key2&&key3) TIME1=0; if (!key2) { if (TIME1==2) { b = b<8?b+1:0; OUT2 = turn[b]; TIME1 = 0; } } if (!key3) { if (TIME1==2) { b = b>0?b-1:7; OUT2 = turn[b]; TIME1 = 0; } } if (key4&&key5) TIME2=0; if (!key4) { if (TIME2==2) { c = c<8?c+1:0; OUT3 = turn[c]; TIME2 = 0; } } if (!key5) { if (TIME2==2) { c = c>0?c-1:7; OUT3 = turn[c]; TIME2 = 0; } } } } void timer()interrupt 1 { TH0=0x3c; TL0=0xb0; TIME++; TIME1++; TIME2++;}

用户评论 (0)

发表评论

captcha