网上有关“求51单片机电子钟的C程序代码”话题很是火热,小编也是针对求51单片机电子钟的C程序代码寻找了一些与之相关的一些信息进行分析,如果能碰巧解决你现在面临的问题,希望能够帮助到您。
您好:手机麻将有挂是真的吗这款游戏可以开挂,确实是有挂的,咨询加微信【】很多玩家在这款游戏中打牌都会发现很多用户的牌特别好,总是好牌,而且好像能看到其他人的牌一样。所以很多小伙伴就怀疑这款游戏是不是有挂,实际上这款游戏确实是有挂的
1.手机麻将有挂是真的吗这款游戏可以开挂,确实是有挂的,通过添加客服微信
2.咨询软件加微信【】在"设置DD功能DD微信手麻工具"里.点击"开启".
3.打开工具.在"设置DD新消息提醒"里.前两个选项"设置"和"连接软件"均勾选"开启"(好多人就是这一步忘记做了)
4.打开某一个微信组.点击右上角.往下拉."消息免打扰"选项.勾选"关闭"(也就是要把"群消息的提示保持在开启"的状态.这样才能触系统发底层接口)
#include<reg52.h>
#define uint unsigned int
#define uchar unsigned char
uchar code table1[]="2011-06-09 week4 N";
uchar code table2[]="11:59:55 ";
uchar code table3[]="12:00 13:00 14:00";
sbit rs=P1^2;
sbit rw=P1^1;
sbit en=P1^0;
sbit k1=P1^4;
sbit k2=P1^5;
sbit k3=P1^6;
sbit k4=P1^7;
sbit min=P3^2;
uchar num,shi=11,fen=59,miao=55,knum,year=11,mon=6,day=9,week=4;shi1=12,fen1=0,miao1=0,shi2=13,fen2=0,miao2=0,shi3=14,fen3=0,miao3=0,i;
/*延时函数*/
void delay(uint z)
{
uint x,y;
for(x=z;x>0;x--)
for(y=100;y>0;y--);
}
/*写命令道液晶*/
void write_com(uchar com)
{
rs=0;
rw=0;
P0=com;
delay(5);
en=1;
delay(5);
en=0;
}
/*写数据到液晶*/
void write_date(uchar date)
{
rs=1;
rw=0;
P0=date;
delay(5);
en=1;
delay(5);
en=0;
}
void zhengshi()
{
for(;fen==0&&miao==0;)
{
for(i=0;i<2;i++)
{
min=0;
delay(500);
min=1;
delay(500);
}
}
}
/*闹钟和正点报时子函数*/
void nao()
{
uchar i;
for(;(shi==shi1&&fen==fen1&&miao==miao1);)
{
for(;1;)
{
min=0;
delay(500);
min=1;
delay(500);
if(k2==0)
break;
}
}
for(;(shi==shi2&&fen==fen2&&miao==miao2);)
{
for(;1;)
{
min=0;
delay(500);
min=1;
delay(500);
if(k2==0)
break;
}
}
for(;(shi==shi3&&fen==fen3&&miao==miao3);)
{
for(;1;)
{
min=0;
delay(500);
min=1;
delay(500);
if(k2==0)
break;
}
}
for(;fen==0&&miao==0;)
{
delay(5);
if((shi==shi1&&fen==fen1&&miao==miao1)||(shi==shi2&&fen==fen2&&miao==miao2)||(shi==shi3&&fen==fen3&&miao==miao3))
break;
else
for(i=0;i<2;i++)
{
min=0;
delay(500);
min=1;
delay(500);
}
}
}
/*写时分秒到液晶*/
void write_sfm(uchar add,uchar date)
{
uchar shi,ge;
shi=date/10;
ge=date%10;
write_com(0x80+0x40+add);
write_date(0x30+shi);
write_date(0x30+ge);
}
void write_nyr(uchar add,uchar date)
{
uchar shi,ge;
shi=date/10;
ge=date%10;
write_com(0x80+add);
write_date(0x30+shi);
write_date(0x30+ge);
}
void write_week(uchar add,uchar date)
{
write_com(0x80+add);
write_date(0x30+date);
}
/*闹钟子函数*/
void write_nao(uchar add,uchar date)
{
uchar shi,ge;
shi=date/10;
ge=date%10;
write_com(0x80+0x40+add);
write_date(0x30+shi);
write_date(0x30+ge);
}
/*定时器1初始化*/
void time() interrupt 1
{
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
num++;
if(num==20)
{
num=0;
miao++;
if(miao==60)
{
miao=0;
fen++;
if(fen==60)
{
fen=0;
shi++;
if(shi==24)
{
shi=0;
day++;
if(day<33)
{
if(mon==1||mon==3||mon==5||mon==7||mon==8||mon==10||mon==12)
{
if(day==32)
{
day=1;
mon++;
}
if(mon==13)
{
mon=1;
year++;
if(year==99)
{
year=1;
}
if(year%4==0)
{
write_com(0x80+17);
write_date('Y');
}
write_nyr(2,year);
}
write_nyr(5,mon);
}
if(mon==2)
{
if(year%4==0)
{
if(day==30)
{
day=1;
mon++;
}
}
else
{
if(day==29)
{
day=1;
mon++;
}
write_nyr(5,mon);
}
}
if(mon==4||mon==6||mon==9||mon==11)
{
if(day==31)
{
day=1;
mon++;
}
write_nyr(5,mon);
}
}
week++;
if(week==8)
week=1;
write_week(15,week);
write_nyr(8,day);
}
write_sfm(0,shi);
}
write_sfm(3,fen);
}
write_sfm(6,miao);
}
}
/*键盘扫描,调整时间与闹钟时间*/
void scan()
{
static uchar k=0;
if(k1==0)
{
delay(10);
if(k1==0)
{
knum++;
while(!k1);
if(knum==1)
{
TR0=0;
write_com(0x80+0x40+14);
write_com(0x0f);
}
if(knum==2)
write_com(0x80+0x40+11);
if(knum==3)
write_com(0x80+0x40+6);
if(knum==4)
write_com(0x80+0x40+3);
if(knum==5)
write_com(0x80+0x40);
if(knum==6)
write_com(0x80+15);
if(knum==7)
write_com(0x80+8);
if(knum==8)
write_com(0x80+5);
if(knum==9)
write_com(0x80+2);
if(knum==10)
write_com(0x80+0x40+0x1a);
if(knum==11)
write_com(0x80+0x40+0x17);
if(knum==12)
write_com(0x80+0x40+0x14);
if(knum==13)
write_com(0x80+0x40+0x11);
if(knum==14)
{
knum=0;
write_com(0x0c);
TR0=1;
}
}
}
if(knum!=0)
{
if(k2==0)
{
delay(10);
if(k2==0)
{
while(!k2);
if(knum==1)
{
fen1++;
if(fen1==60)
fen1=0;
write_nao(14,fen1);
write_com(0x80+0x40+14);
}
if(knum==2)
{
shi1++;
if(shi1==24)
shi1=0;
write_nao(11,shi1);
write_com(0x80+0x40+11);
}
if(knum==3)
{
miao++;
if(miao==60)
miao=0;
write_sfm(6,miao);
write_com(0x80+0x40+6);
}
if(knum==4)
{
fen++;
if(fen==60)
fen=0;
write_sfm(3,fen);
write_com(0x80+0x40+3);
}
if(knum==5)
{
shi++;
if(shi==24)
shi=0;
write_sfm(0,shi);
write_com(0x80+0x40);
}
if(knum==6)
{
week++;
if(week==8)
week=1;
write_week(15,week);
write_com(0x80+15);
}
if(knum==7)
{
day++;
week++;
if(week==8)
week=1;
write_week(15,week);
write_com(0x80+15);
if(mon==1||mon==3||mon==5||mon==7||mon==8||mon==10||mon==12)
{
if(day==32)
day=1;
write_nyr(8,day);
write_com(0x80+8);
}
if(mon==2)
{
if(year%4==0)
{
if(day==30)
day=1;
}
else
{
if(day==29)
day=1;
}
write_nyr(8,day);
write_com(0x80+8);
}
if(mon==4||mon==6||mon==9||mon==11)
{
if(day==31)
day=1;
write_nyr(8,day);
write_com(0x80+8);
}
}
if(knum==8)
{
mon++;
if(mon==13)
mon=1;
write_nyr(5,mon);
write_com(0x80+5);
}
if(knum==9)
{
year++;
if(year==100)
year=1;
write_nyr(2,year);
write_com(0x80+2);
if(year%4==0)
{
write_com(0x80+17);
write_date('Y');
}
if(year%4!=0)
{
write_com(0x80+17);
write_date('N');
}
}
if(knum==10)
{
fen3++;
if(fen3==60)
fen3=0;
write_nao(0x1a,fen3);
write_com(0x80+0x40+0x1a);
}
if(knum==11)
{
shi3++;
if(shi3==24)
shi3=0;
write_nao(0x17,shi3);
write_com(0x80+0x40+0x17);
}
if(knum==12)
{
fen2++;
if(fen2==60)
fen2=0;
write_nao(0x14,fen2);
write_com(0x80+0x40+0x14);
}
if(knum==13)
{
shi2++;
if(shi2==24)
shi2=0;
write_nao(0x11,shi2);
write_com(0x80+0x40+0x11);
}
}
}
if(k3==0)
{
delay(10);
if(k3==0)
{
while(!k3);
if(knum==1)
{
fen1--;
if(fen1==-1)
fen1=59;
write_nao(14,fen1);
write_com(0x80+0x40+14);
}
if(knum==2)
{
shi1--;
if(shi1==-1)
shi1=23;
write_nao(11,shi1);
write_com(0x80+0x40+11);
}
if(knum==3)
{
miao--;
if(miao==-1)
miao=59;
write_sfm(6,miao);
write_com(0x80+0x40+6);
}
if(knum==4)
{
fen--;
if(fen==-1)
fen=59;
write_sfm(3,fen);
write_com(0x80+0x40+3);
}
if(knum==5)
{
shi--;
if(shi==-1)
shi=23;
write_sfm(0,shi);
write_com(0x80+0x40);
}
if(knum==6)
{
week--;
if(week==0)
week=7;
write_week(15,week);
write_com(0x80+15);
}
if(knum==7)
{
day--;
week--;
if(week==0)
week=7;
write_week(15,week);
write_com(0x80+15);
if(mon==1||mon==3||mon==5||mon==7||mon==8||mon==10||mon==12)
{
if(day==0)
day=31;
write_nyr(8,day);
write_com(0x80+8);
}
if(mon==2)
{
if(year%4==0)
{
if(day==0)
day=29;
}
else
{
if(day==0)
day=28;
}
write_nyr(8,day);
write_com(0x80+8);
}
if(mon==4||mon==6||mon==9||mon==11)
{
if(day==0)
day=30;
write_nyr(8,day);
write_com(0x80+8);
}
}
if(knum==8)
{
mon--;
if(mon==0)
mon=12;
write_nyr(5,mon);
write_com(0x80+5);
}
if(knum==9)
{
year--;
if(year==0)
year=99;
write_nyr(2,year);
write_com(0x80+2);
if(year%4==0)
{
write_com(0x80+17);
write_date('Y');
}
if(year%4!=0)
{
write_com(0x80+17);
write_date('N');
}
}
if(knum==10)
{
fen3--;
if(fen3==-1)
fen3=59;
write_nao(0x1a,fen3);
}
关于“求51单片机电子钟的C程序代码”这个话题的介绍,今天小编就给大家分享完了,如果对你有所帮助请保持对本站的关注!