求求大佬們看看哪出問題了,1602模塊沒問題 仿真里讀出來的是一個黑塊
at24c02.c
main.c
- #include <reg52.h>
- #include <intrins.h>
- #include "at24c02.h"
- #include "proteus_1602.h"
- #define uchar unsigned char
- #define uint unsigned int
- sbit SCK = P1^3;
- sbit SDA = P1^4;
- void main(){
- Delayms(2000);
- while(1){
- uchar temp = 0;
- init();
- init_1602();
- addByte(0x00, 0x00);
- Delayms(10);
- temp = readAddByta(0x00);
- writeData_1602(temp + 0x38);
- Delayms(50);
- }
- }
復制代碼
|