欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 2243|回復: 0
收起左側

獨立按鍵控制數碼管加減法要求顯示(-10——10)

[復制鏈接]
ID:551909 發表于 2019-5-31 15:48 | 顯示全部樓層 |閱讀模式
#include<stc15.h>
#include<intrins.h>
#include<gpio.h>
#define uchar unsigned char
#define uint unsigned int
#include<595hc.h>
sbit SW17=P3^2;
sbit SW18=P3^3;
uint counter=0;
void Delay10ms()       
{
        unsigned char i, j;

        i = 108;
        j = 145;
        do
        {
                while (--j);
        } while (--i);
}
void main(void)
{
  gpio();
  while(1)
  {
    if(SW17==0)
        {
          Delay10ms();
          if(SW17==0)
          {
            counter++;
                if(counter>10)counter=0;
        }
          while(SW17==0);
          }
          if(SW18==0)
          {
           Delay10ms();
           if(SW18==0)
           {
           if(counter!=0)
           {
             counter--;
                 }
                }
                while(SW18==0);
        }
        Dis_buf[7]=counter%10;
        Dis_buf[6]=counter/10%10;
//        Dis_buf[5]=counter/100%10;
//        Dis_buf[4]=counter/1000%10;
//        Dis_buf[3]=counter/10000%10;
           display();
        }
}

回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表