C语言源程序 - 创意设计之LED摇摇棒
C语言源程序
#include
char KY;
unsigned char code GB_16[] =
{
0x00,0x00,0x00,0x00,0x1F,0xE0,0x0F,0xC0, //中
0x08,0x40,0x08,0x40,0x08,0x40,0xFF,0xFF,
0x7F,0xFE,0x08,0x40,0x08,0x40,0x08,0x40,
0x0F,0xE0,0x1F,0xC0,0x08,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xFF,0xFF,0x7F,0xFE, //国
0x40,0x0A,0x49,0x0A,0x49,0x0A,0x4F,0xFA,
0x4F,0xFA,0x49,0xCA,0x5B,0x7A,0x49,0x2A,
0x40,0x0A,0x7F,0xFF,0xFF,0xFE,0x40,0x00,
0x00,0x00,0x08,0x01,0x08,0x0E,0xFF,0xFC, //加
0x7F,0xF0,0x08,0x04,0x08,0x02,0x0F,0xFF,
0x1F,0xFE,0x08,0x00,0x3F,0xFE,0x1F,0xFC,
0x10,0x08,0x10,0x08,0x1F,0xFE,0x3F,0xFC,
0x00,0x00,0x08,0x20,0x87,0x1E,0x72,0x7F, //油
0x31,0xC6,0x06,0x00,0x00,0x00,0x1F,0xFF,
0x0F,0xFE,0x08,0x42,0xFF,0xFE,0x7F,0xFE,
0x08,0x42,0x0F,0xFF,0x1F,0xFE,0x08,0x00
};
void DelayUs(unsigned int N)
{
unsigned int x;
for(x=0; x<=N;x++);
}
void intersvr0(void) interrupt 0 using 1
{
int i;
KY=~KY;
if(KY==0){
DelayUs(1200);
for(i=0;i<64;i++){
P2=~GB_16[i*2];
P0=~GB_16[i*2+1];
DelayUs(80);
P2=0xff;P0=0xff;
}
}
}
/*演示主程序*/
void main(void)
{
IT0=1;EX0=1;
EA=1;
KY=0;
P0=0xff;
P2=0xff;
while(1){
}
}
- 第 1 页:创意设计之LED摇摇棒
- 第 2 页:C语言源程序
本文导航
非常好我支持^.^
(94) 51.9%
不好我反对
(87) 48.1%
相关阅读:
- [电子说] 【创意设计】小凌派手势应用之原力控制星球大战BB-8机器人 2022-05-24
- [电子说] AI 绘画大热 ChatGPT 爆火,创意设计从业者准备好被取代了吗? 2023-02-20
- [电子说] Adobe已经这么厉害了,为何还要帮助创意设计人才实现数字化转型? 2023-02-16
- [电子说] 海信联合站酷开展ULED壁纸创意设计大赛 2022-02-18
- [今日头条] 一场与直线电机紧密相关的创意设计大赛在湘潭市举行 2021-11-26
- [今日头条] 车载空气净化器创意设计丰富了产品的功能体验 2021-06-07
- [电子说] 产品创意设计能否真正落地,如何确保产品创意落地 2021-05-28
- [今日头条] led显示屏不断的创意设计,为我们带来了更好的体验 2020-08-04
( 发表人:爱电路 )