header.c
sfr Data = 0x80;
sbit LE0 = P2^7;
sbit LE1 = P2^6;
sbit LE2 = P2^5;
sbit G_SW = P2^4;
sbit G_LCD = P2^3;
sbit Start = P1^0;
sbit Sensor6 = P1^2;
sbit Sensor5 = P1^3;
sbit Sensor4 = P1^4;
sbit Sensor3 = P1^5;
sbit Sensor2 = P1^6;
sbit Sensor1 = P1^7;//00xx0011
//11001100
sbit Press1 = P1^1;
sbit Press2 = P3^6;
sbit Press3 = P3^7;
#define Forward 0xA0
#define Reverse 0x20
#define RunmaxF 0xDF
#define RunmaxR 0x5F
#define Off 0xFF
//submotor interface
#define Subreverse 0
#define Subforward 1
#define Run 2
#define Stop 3
void delay10ms(void)
{
long n;
for(n=0;n<200;n++);
}
void delaylong(long m)
{
long n;
for(n=0;n<m;n++);
}
// 00000 M n RF
//runmaxF 1 1 0 1 1111
// Forward 1 0 1 0 0000
// Reverse 0 0 1 0 0000
// RF n M 00000
// Motor phu
// 0 0
// x x OF3 RF3 OF2 RF2 OF1 RF1
//Motorphu Forward
// 0 0 n n n n 0 1
// 0 0 n n n n 0 0
// 0 0 // x x OF3 RF3 OF2 RF2 OF1 RF1
sbit LE0 = P2^7;
sbit LE1 = P2^6;
sbit LE2 = P2^5;
sbit G_SW = P2^4;
sbit G_LCD = P2^3;
sbit Start = P1^0;
sbit Sensor6 = P1^2;
sbit Sensor5 = P1^3;
sbit Sensor4 = P1^4;
sbit Sensor3 = P1^5;
sbit Sensor2 = P1^6;
sbit Sensor1 = P1^7;//00xx0011
//11001100
sbit Press1 = P1^1;
sbit Press2 = P3^6;
sbit Press3 = P3^7;
#define Forward 0xA0
#define Reverse 0x20
#define RunmaxF 0xDF
#define RunmaxR 0x5F
#define Off 0xFF
//submotor interface
#define Subreverse 0
#define Subforward 1
#define Run 2
#define Stop 3
void delay10ms(void)
{
long n;
for(n=0;n<200;n++);
}
void delaylong(long m)
{
long n;
for(n=0;n<m;n++);
}
// 00000 M n RF
//runmaxF 1 1 0 1 1111
// Forward 1 0 1 0 0000
// Reverse 0 0 1 0 0000
// RF n M 00000
// Motor phu
// 0 0
// x x OF3 RF3 OF2 RF2 OF1 RF1
//Motorphu Forward
// 0 0 n n n n 0 1
// 0 0 n n n n 0 0
// 0 0 // x x OF3 RF3 OF2 RF2 OF1 RF1
Comment