新聞中心

EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > STC11F04單片機(jī)制作的32燈搖搖棒

STC11F04單片機(jī)制作的32燈搖搖棒

作者: 時(shí)間:2016-11-30 來源:網(wǎng)絡(luò) 收藏
說到搖搖棒,大家應(yīng)該不陌生,但這款搖搖棒,用了一片20腳的STC11F04單片機(jī),控制32只發(fā)光二極管,能顯示13組左右的字或者圖片,能顯示高32寬64的圖像和字體任意,開機(jī)后自動(dòng)切換每一組字,按了一下背部的開關(guān)后變成手動(dòng)切換!能根據(jù)自己的喜好用字模軟件編寫各種各樣的字體和圖片,方法很簡(jiǎn)單!只要有單片機(jī)的一點(diǎn)基礎(chǔ)就可以隨意的玩耍,送給朋友和喜歡的人是件不錯(cuò)的禮物哦!此搖搖棒其實(shí)是沒限制的,可以顯示高32寬很長(zhǎng)的字和圖片,只不過麻煩的是要手晃得大一點(diǎn)而已!所以通常都限制在合適的范圍!資料來源于網(wǎng)絡(luò),作者:張國(guó)榮。





本文引用地址:http://m.butianyuan.cn/article/201611/324018.htm



#include
/*********外部接口定義**********/
#define uchar unsigned char
#define uint unsigned int //宏定義
#define out P1 //數(shù)據(jù)輸出端口
sbit led1=P3^0; //第1組LED
sbit led2=P3^1; //第2組LED
sbit led3=P3^3; //第3組LED
sbit led4=P3^4; //第4組LED
sbit key1=P3^5; //按鍵輸入
sbit p3_2=P3^2;
uchar KY; //KY作用在后面說明
uchar BUFF; //緩存
/*********全局變量定義**********/
unsigned long int TimeCount=0;
unsigned int DelayN=80, //延時(shí)臨時(shí)計(jì)數(shù)
DelayTime=80; //每次延時(shí)的周期個(gè)數(shù)
unsigned char key;
/**********************************************/
void delay(unsigned char n);
void DelayMs(void);
/*******************************************/
unsigned char code text1[] = {
0xEF,0x7F,0xEF,0xBC,0x0F,0xDD,0xE0,0xEB,0xEF,0xF3,0x0F,0x8C,0x7F,0xDF,0x7D,0xFF,0x7D,0xBF,0x7D,0x7F,0x0D,0x80,0x75,0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