码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2020-04-13 19:48:27      阅读:66      评论:0      收藏:0      [点我收藏+]

标签:+=   dash   span   code   temp   代码   col   har   das   

 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个隔位的代码——学弟的思路,蛮不错的。

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

标签:+=   dash   span   code   temp   代码   col   har   das   

原文地址:https://www.cnblogs.com/action0/p/12693317.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!