?? at24c256.c
字號:
#include<reg52.h>
#include<absacc.h>
#include<MY7219.h>
#include<SerialPort.h>
//#include<DS1302.h>
#include<I2C.h>
#include<I2C_EEPROM.h>
//#include<28C64_6264.h>
void Display_LED(unsigned char location,unsigned char *dat,unsigned char n)
{
unsigned char i;
for(i=0;i<n;i++)
{
LED_Drive(location+i,dat[i]&0x0f);
}
}
/*
void DisplayTimer(unsigned char LED_START,unsigned char *sec)
{
unsigned char Timer[7],x,y;
GetTimer(Timer);
x=(Timer[2]&0xf0)>>4;
LED_Drive(LED_START,x);
x=Timer[2]&0x0f;
y=Timer[1]&0x0f;
if(*sec!=Timer[0])
{
x+=0x80;
y+=0x80;
*sec=Timer[0];
}
LED_Drive(LED_START+1,x);
LED_Drive(LED_START+2,(Timer[1]&0xf0)>>4);
LED_Drive(LED_START+3,y);
LED_Drive(LED_START+4,(Timer[0]&0xf0)>>4);
LED_Drive(LED_START+5,Timer[0]&0x0f);
}
*/
void main()
{
unsigned char dat[16]={1,9,8,2,0,1,3,0,0,0,0x0a,0x0d,0x0c,0x0d,0x0e,0x0f};
// unsigned char dd[6];
/*
unsigned char code Time[7]={
0x04,//sec
0x09,//min
0x01,//hour
0x01,//date
0x02,//month
0x05,//dat
0x00,//year
};
*/
unsigned char code Time2[]={0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x09,0x08};
unsigned char c=0;
XBYTE[0x03]=1;
InitSerialPort0();
Init_MAX7219();
Cls();
Display_LED(0,dat,6);
Delay7219(3000);
//Write_I2C_EEPROM(0,0x00,Time2,8);
Delay7219(100);
while(1)
{
Read_I2C_EEPROM(0,0x02,dat,7);
Display_LED(0,dat,6);
Delay7219(1000); }
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -