点亮8个隔位的代码——全点亮

 1     uchar c;
 2     c=8;
 3     if(num%2==0)
 4         c=7;
 5     if(n>=8&&temp!=255)
 6         n=n-c;    //2  为7        3   为8          4    为7            5为8
 7     temp+=pow(2,n);
 8     n+=num;
 9     P1=~temp;
10     delay(200);

这是点亮8个隔位的代码——学弟的思路,蛮不错的。

posted @ 2020-04-13 19:12  明语  阅读(387)  评论(0)    收藏  举报