嵌入式蓝桥杯关于E2PROM存储的一个小知识难点
其实也没什么难的 会的一看就会了
不会的我想了好久也没想出来
这个其实就是没有上电的时候使用它的初始值
上电之后使用它的设定的值
一个简单的代码就可以帮你实现
if(My_IIC_Read(0xfc)!=20)
{
my_iic_write(0xff,30);
Delay_Ms(20);
my_iic_write(0xfe,50);
Delay_Ms(20);
my_iic_write(0xfd,70);
Delay_Ms(20);
my_iic_write(0xfc,20);
Delay_Ms(20);
}
IIC_Read_Data();
void IIC_Read_Data(void)
{
Thre_1_num=My_IIC_Read(0xff);
Delay_Ms(20);
Thre_2_num=My_IIC_Read(0xfe);
Delay_Ms(20);
Thre_3_num=My_IIC_Read(0xfd);
Delay_Ms(20);
}