📄 cdd
字号:
//LCD12864P.c
#include "AT89x051.h"
#include <stdlib.h>
#include<math.h>
#include<intrins.h>
#define Ledlight() (P0 &= 0x7f)
#define Leddark() (P0 |= 0x80)
sbit LED3=P0^0;
sbit LED4=P0^1;
sbit LED5=P0^2;
sbit LED6=P0^3;
sbit LED7=P0^4;
sbit LED8=P0^5;
sbit LED9=P0^6;
main() {
Intial();
if (P1^1==1&&P1^3==1&&P1^4==1&&P1^6==1&&P2^3==1&&P1^2==0)//STEP 1
P1^0=1;
else
LED3=1;
if (P1^2==1&&P1^3==0) //STEP 2
P2^1=0;
else
LED4=1;
if (P2^0==0) //STEP 3
P1^0=Square(40);
else
LED5;
if (P1^5==1) //STEP 5
P1^4=0;
DelayTime (1000000);
if (P1^5==0) //STEP 6
LED7;
else LED6;
}
void Initall(void)
{
TMOD = 0x11;
IP = 0x8;
IE = 0x8A;
TCON = 5;
TR0 = 1;
TR1 = 0;
ET0 = 1;
ET1 = 0;
P1 = 0xff;
}
void DelayTimes(unsigned int time)
{
unsigned char temp;
for(;time=0;time--)
for(temp=112;temp!=0;temp--);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -