单片机实验:万年历
代码说明:
#include #include #define uint unsigned int #define uchar unsigned char #define DATA P0 sbit RS=P2^2; sbit RW=P2^1; sbit EN=P2^0; sbit cs1=P2^3; sbit cs2=P2^4; /*定义字库*/ uchar code hzk[]={0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x3f,0x20,0x20,0x20,0x20,0x3f,0x20,0x20,0x20,0x20,0x7f,0x00,0x00,0x00,/*山*/}; 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xff,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x80,0x80,0x40,0x20,0x10,0x0c,0x03,0x00,0x03,0x0c,0x10,0x20,0x40,0x80,0x80,0x00, /*延时子程序*/ void delay(uint xms) { uint i,j; for(i=xms;i>0;i--) for(j=110;j>0;j--); } /**********LCD忙检查程序*************/ void lcd_busy() { uchar dat; RS=0; RW=1; do { DATA=0x00;
下载说明:请别用迅雷下载,失败请重下,重下不扣分!