學單片機有兩個周的時間了,一直用的軟件仿真,覺的沒有成就感, 上周六自己動手做了一塊試驗板( 樣子有點嚇人,但畢竟是自已做的第一塊板子),一共下來才幾十塊錢。把板子的相片發上來涼下………… 相片傳不上,發個連接給大家…… 連接地址http://user.qzone.qq.com/274416109/photo/55e84ca5-4041-461f-a9c3-92cf292af35c 試驗用的小程序: #include<reg52.h> #define uint unsigned int #define uchar unsigned char uchar code table[]={0x3f,0x06,0x5b,0x4f,0x66, 0x6d,0x7d,0x07,0x7f,0x6f, 0x77,0x7c,0x39,0x5e,0x79, 0x71,0x79,0x5e,0x39,0x7c, 0x77,0x6f,0x7f,0x07,0x7d, 0x6d,0x66,0x4f,0x5b,0x06, 0x3f,}; uchar code table1[]={0x3f,0x06,0x5b,0x4f,0x66, 0x6d,0x7d,0x07,0x7f,0x6f, 0x77,0x7c,0x39,0x5e,0x79, 0x71,0x79,0x5e,0x39,0x7c, 0x77,0x6f,0x7f,0x07,0x7d, 0x6d,0x66,0x4f,0x5b,0x06, 0x3f,}; sbit WL=P2^0; sbit DL=P2^1; void delay(); void main() { P0=0XFF; P1=0XFF; WL=1; P0=0X00; WL=0; while(1) { uchar num; for(num=0;num<32;num++) { DL=1; P0=table[num]; DL=0; P1=table[num]; delay(); } } } void delay() { uint i; for(i=0;i<35000;i++); }
[此貼子已經被作者于2009-4-15 13:04:08編輯過]
|