查看文章
 
8x8 LED 点阵 字母、数字
2010年07月24日 星期六 下午 10:42
推荐一个模拟软件8x8点阵字模提取软件.875.rar:http://down.qiannao.com/space/file/dream1211/share/8x8-70b9-9635-5b57-6a21-63d0-53d6-8f6f-4ef6.875.rar/.page

#include<avr/io.h>
#include<util/delay.h>
#include <avr/interrupt.h>
const unsigned char REFRESH = 0x08,
cSet[40][8] = { 195,189,157,173,181,185,189,195, //0
239,231,227,231,231,231,231,195, //1
195,129,159,207,231,243,129,129, //2
195,153,159,199,199,159,153,195, //3
223,207,215,219,221,1,223,223, //4
131,249,249,193,159,159,153,195, //5
199,147,249,193,129,153,153,195, //6
195,129,159,159,207,207,231,231, //7
199,187,187,199,199,187,187,199, //8
199,187,187,135,191,187,187,199, //9
195,189,189,189,129,189,189,189, //A
193,189,189,193,221,189,189,193, //B
199,147,185,249,249,185,147,199, //C
225,221,189,189,189,189,221,225, //D
129,129,249,193,193,249,129,129, //E
129,129,249,193,193,249,249,249, //F
135,195,241,249,9,153,131,135, //G
153,153,153,129,129,153,153,153, //H
195,231,231,231,231,231,231,129, //I
135,207,207,207,207,205,201,227, //J
49,219,235,243,243,235,219,49, //K
241,251,251,251,251,251,123,129, //L
255,189,153,165,189,189,24,255, //M
255,189,185,181,173,157,189,255, //N
195,153,189,60,60,189,153,195, //O
193,153,185,153,193,249,249,240, //P
195,153,189,189,173,157,185,67, //Q
199,187,187,187,195,235,219,187, //R
199,187,251,247,207,191,187,199, //S
0,0,231,231,231,231,231,231, //T
255,153,153,153,153,153,129,195, //U
255,189,189,189,153,195,231,255, //V
255,126,102,36,36,165,129,195, //W
255,153,219,231,231,219,153,255, //X
126,60,153,195,231,231,231,231, //Y
129,129,205,231,231,179,129,129, //Z
};
volatile char nRow = 0x00,
i = 0;
volatile int cnt = 0;
ISR (TIMER0_OVF_vect)
{
if (nRow == 0x08)
nRow = 0x00;
if (cnt == 3000){
i++;
if (i==37) i=0;
cnt=0;
}
PORTA = 0xFF;
PORTE = nRow;
PORTA = cSet[i][nRow];
nRow++;
cnt++;
}
int main()
{
TCCR0 |= ((0<<CS02) | (1<<CS01) | (0<<CS00));
TIMSK |= (1<<TOIE0);
sei();
DDRA = 0xFF;
DDRE = 0x07;
while (1);
}






类别:单片机||添加到搜藏 |分享到i贴吧|浏览(1213)|评论 (0)
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
     

   
帮助中心 | 空间客服 | 投诉中心 | 空间协议
©2012 Baidu