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

Posted action0

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了点亮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个隔位的代码——学弟的思路,蛮不错的。

以上是关于点亮8个隔位的代码——全点亮的主要内容,如果未能解决你的问题,请参考以下文章