MÌNH CÓ ĐOẠN CODE DƯỚI ĐÂY. PRO NÀO GIẢI THÍCH DÙM MÌNH TỪNG DÒNG LỆNH ĐÍNH KÈM VỚI.
NẾU MUỐN TẠO THÊM CHỮ CHẠY THÌ PHẢI LÀM SAO?
MUỐN TẠO THÊM CODE HIỆN THỊ CHỮ NHƯ Ở DƯỚI THÌ DÙNG PHẦN MỀM NÀO VẬY?
MẤY BẠN DOWN VỀ TEST RỒI CHỈ GIÚP MÌNH VỚI NHÉ. CẢM ƠN NHIỀU!!!
matrix thang.rar
NẾU MUỐN TẠO THÊM CHỮ CHẠY THÌ PHẢI LÀM SAO?
Code:
#include <REGX51.H> sbit DATA = P1^0; sbit SH_CP = P1^1; sbit ST_CP = P1^2; unsigned char code hang[100]={ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFC,0xFC,0xFC,0x00,0x00,0xFC,0xFC,0xFC, // T 0xFF,0x00,0x00,0xE7,0xE7,0x00,0x00,0xFF, //H 0xFF,0x03,0x01,0xCC,0xCC,0x01,0x03,0xFF, //a 0xFF,0x00,0x00,0xF3,0xE7,0x00,0x00,0xFF, //N 0xFF,0x00,0x00,0xE7,0xE7,0x00,0x00,0xFF, //H 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,//tao khoang trong 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, }; unsigned int cot[8]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80}; unsigned int n,m,k; void delay( unsigned int ms) { unsigned int i,j; for(i=0;i<ms;i++); { for(j=0;j<125;j++) {;} } } //--------- Chuye^n no^'i tie^'p sang song song void convert (unsigned int x) { unsigned int n,tg; for(n=0;n<8;n++) { tg=x; tg=tg&0x80; if(tg==0x80) DATA=1; else DATA=0; x=x<<1; SH_CP=0; SH_CP=1; } } void main() { while(1) { for(m=0;m<72;m++)//do dai chu { for(k=0;k<5;k++)//toc do chay chu { for(n=m;n<=7+m;n++) { convert(hang[n]); if(n<8)convert(0xff); else convert(hang[n-8]); if(n<16)convert(0xff); else convert(hang[n-16]); if(n<24)convert(0xff); else convert(hang[n-24]); P2=cot[n-m]; ST_CP=1; ST_CP=0; delay(100); } } } } }
Code:
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFC,0xFC,0xFC,0x00,0x00,0xFC,0xFC,0xFC, // T 0xFF,0x00,0x00,0xE7,0xE7,0x00,0x00,0xFF, //H 0xFF,0x03,0x01,0xCC,0xCC,0x01,0x03,0xFF, //a 0xFF,0x00,0x00,0xF3,0xE7,0x00,0x00,0xFF, //N 0xFF,0x00,0x00,0xE7,0xE7,0x00,0x00,0xFF, //H 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,//tao khoang trong 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
matrix thang.rar
Comment