文件名称:点阵左移代码
文件大小:5KB
文件格式:C
更新时间:2017-05-28 11:17:38
点阵左移动
#include "REG51.H" sbit P13=P1^3; sbit P14=P1^4; unsigned char code Fonts[][32]= { {0xFF,0xFF,0xFF,0xFF,0x7F,0xFF,0x7F,0xFF, 0x07,0xF0,0x77,0xF7,0x77,0xF7,0x07,0xF0, 0x77,0xF7,0x77,0xF7,0x07,0xF0,0x7F,0xDF, 0x7F,0xDF,0x7F,0xC0,0xFF,0xFF,0xFF,0xFF}, {0xFF,0xFF,0x07,0xE0,0xFF,0xFB,0xFF,0xFD, 0xFF,0xFE,0x7F,0xFF,0x7F,0xFF,0x01,0x80, 0xFF,0xFE,0xFF,0xFE,0xFF,0xFE,0xFF,0xFE, 0xDF,0xFE,0xBF,0xFE,0x7F,0xFF,0xFF,0xFF}, {0xFF,0xFF,0x7F,0xF0,0x7B,0xF7,0x77,0xF7, 0x41,0xF7,0x97,0xC7,0x37,0xE0,0xF7,0xEF, 0x77,0xF7,0xF7,0xFA,0xD7,0xFD,0xE7,0xFA, 0x77,0xF7,0x9F,0x8F,0xFF,0xFF,0xFF,0xFF}, {0xFF,0xFF,0xFF,0xFD,0xFB,0xFD,0xF7,0xFD, 0xC1,0xFD,0xF7,0xFD,0x17,0xC0,0xF7,0xFD, 0xF7,0xFD,0xF7,0xFD,0xD7,0xFD,0xE7,0xFD, 0xF7,0xFD,0xFF,0xFD,0xFF,0xFD,0xFF,0xFF}, {0xFF,0xFF,0xFF,0xFF,0x7F,0xFF,0x7F,0xFF, 0x7F,0xFF,0x01,0xC0,0x7F,0xFF,0x7F,0xFF, 0xBF,0xFE,0xDF,0xFD,0xEF,0xFB,0xF7,0xF7, 0xFB,0xEF,0xFD,0x9F,0xFF,0xFF,0xFF,0xFF}, {0x7F,0xFF,0xFF,0xFE,0x01,0x80,0xDD,0xBB, 0x07,0xE0,0x0F,0xF0,0x03,0xC0,0xEF,0xF7, 0x17,0xE8,0xDB,0xDB,0x5D,0xBA,0x5F,0xFA, 0x7F,0xFE,0xBF,0xFD,0xDF,0xFB,0xFF,0xFF} }; void delay() { unsigned char i; i=100; while(i--); } void main() { unsigned char i,j,w; unsigned int k; while(1) { for(i=0;i<6;i++) { for(k=0;k<150;k++) { w=0x00; for(j=0;j<16;j++) { P13=1; P14=1; P0=Fonts[i][j]; P2=w++; P13=0; delay(); } w=0x00; for(j=0;j<16;j++) { P13=1; P14=1; P0=Fonts[i][j+16]; P2=w; w+=0x10; P14=0; delay(); } } } } }