C語言源程序 - 創(chuàng)意設(shè)計(jì)之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 頁:創(chuàng)意設(shè)計(jì)之LED搖搖棒
- 第 2 頁:C語言源程序
本文導(dǎo)航
非常好我支持^.^
(94) 51.9%
不好我反對
(87) 48.1%
相關(guān)閱讀:
- [電子說] 【創(chuàng)意設(shè)計(jì)】小凌派手勢應(yīng)用之原力控制星球大戰(zhàn)BB-8機(jī)器人 2022-05-24
- [電子說] AI 繪畫大熱 ChatGPT 爆火,創(chuàng)意設(shè)計(jì)從業(yè)者準(zhǔn)備好被取代了嗎? 2023-02-20
- [電子說] Adobe已經(jīng)這么厲害了,為何還要幫助創(chuàng)意設(shè)計(jì)人才實(shí)現(xiàn)數(shù)字化轉(zhuǎn)型? 2023-02-16
- [電子說] 海信聯(lián)合站酷開展ULED壁紙創(chuàng)意設(shè)計(jì)大賽 2022-02-18
- [今日頭條] 一場與直線電機(jī)緊密相關(guān)的創(chuàng)意設(shè)計(jì)大賽在湘潭市舉行 2021-11-26
- [今日頭條] 車載空氣凈化器創(chuàng)意設(shè)計(jì)豐富了產(chǎn)品的功能體驗(yàn) 2021-06-07
- [電子說] 產(chǎn)品創(chuàng)意設(shè)計(jì)能否真正落地,如何確保產(chǎn)品創(chuàng)意落地 2021-05-28
- [今日頭條] led顯示屏不斷的創(chuàng)意設(shè)計(jì),為我們帶來了更好的體驗(yàn) 2020-08-04
( 發(fā)表人:愛電路 )