您当前的位置:五五电子网电子知识单片机-工控设备PIC单片机pic16f877a c语言时钟程序 正文
pic16f877a c语言时钟程序

pic16f877a c语言时钟程序

点击数:7778 次   录入时间:03-04 11:51:34   整理:http://www.55dianzi.com   PIC单片机
 //#int_timer1
 //void timer1_interrupt(void)
 #int_ccp2
 void ccp2_interrupt(void)
 {
    //TMR1H = 0x80;
    if (CurrentTime.secondl==9)
    {
        CurrentTime.secondl=0;
        if (CurrentTime.secondh==5)
        {
            CurrentTime.secondh=0;
            if (CurrentTime.minutel==9)
            {
                CurrentTime.minutel=0;
                if (CurrentTime.minuteh==5)
                {
                    CurrentTime.minuteh=0;
                    if (CurrentTime.hourl==9)
                    {
                        CurrentTime.hourl=0;
                        CurrentTime.hourh++;
                    }
                    else if((CurrentTime.hourl==3) && (CurrentTime.hourh==2))
                    {
                        CurrentTime.hourl=0;
                        CurrentTime.hourh=0;
                        if ((((CurrentDate.dayl == 8) || (CurrentDate.dayl == 9)) && (CurrentDate.dayh == 2) && (CurrentDate.monthl == 2) && (CurrentDate.monthh == 0)) ||
                            ((CurrentDate.dayl == 0) && (CurrentDate.dayh == 3) && ((((CurrentDate.monthl == 4) || (CurrentDate.monthl == 6)
                                || (CurrentDate.monthl == 9)) && (CurrentDate.monthh == 0)) || ((CurrentDate.monthl == 1) && (CurrentDate.monthh == 1)))) ||
                            ((CurrentDate.dayl == 1) && (CurrentDate.dayh == 3)))
                        {
                            CurrentDate.dayl=1;
                            CurrentDate.dayh=0;
                            if ((CurrentDate.monthl == 2) && (CurrentDate.monthh == 1))
                            {
                                CurrentDate.monthl = 1;
                                CurrentDate.monthh = 0;
                                if (CurrentDate.year4 == 9)
                                {
                                    CurrentDate.year4 = 0;
                                    if (CurrentDate.year3 == 9)
                                    {
                                        CurrentDate.year3 = 0;
                                        if (CurrentDate.year2 == 9)
                                        {
                                            CurrentDate.year2 = 0;

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17]  下一页


本文关键字:程序  C语言  PIC单片机单片机-工控设备 - PIC单片机