DS1302时钟1602液晶显示 //寄存器宏定义 #include #include #define WRITE_SECOND 0x80 #define WRITE_MINUTE 0x82 #define WRITE_HOUR 0x84 #define WRITE_DATE 0x86 #define WRITE_MONTH 0x8
DS18B20温度计1602液晶显示温度 #include #defineucharunsignedchar #defineuintunsignedint sbitDQ=P3^7;//ds18b20与单片机连接口 sbitRS=P3^0; sbitRW=P3^1; sbitEN=P3^2; unsignedcharcodestr1[]
基于I2C总线的EEPROMAT24C02A #include #define uchar unsigned char sbit sda=P1^0; sbit scl=P1^1; uchar a; void delay() { ;; } void start() //开始信号 { sda=1; delay(); scl=1; delay();