当前位置:   article > 正文

独立按键控制流水灯c语言程序,给大家分享下单片机独立按键控制花样流水灯程序Proteus仿真...

uchar code tab2[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};什么意思

#include

#define        uint        unsigned int

#define        uchar        unsigned char

sbit k1=P1^0;

uchar code table0[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};//LED从低位往高位移

uchar code table1[]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe};//LED从高位往低位移

uchar code table2[]={0xfe,0xfc,0xf8,0xf0,0xe0,0xc0,0x80,0x00};//LED从1个亮到8个都点亮(从低位往高位)

uchar code table3[]={0x7f,0x3f,0x1f,0x0f,0x07,0x03,0x01,0x00};//LED从1个亮到8个都点亮(从高位往低位)

uchar i,tm;

uchar num=0;

void disp1();

void disp2();

void disp3();

void disp4();

void delay_ms(unsigned int tim);  //延时函数

void t0isr() interrupt 1

{

TH0=(65536-50000)/256;

TL0=(65536-50000)%256;

tm++;

if(tm>=10)

{

tm=0;

switch(num)

{

cas

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小惠珠哦/article/detail/752225
推荐阅读
相关标签
  

闽ICP备14008679号