weizhongc 发表于 2015-8-18 08:54
void write_add(uint address,uchar date)
{
start();
write_byte(0xa0);
respons();
write_byte((add ...
void write_add(uint address,uchar date)
{
start();
write_byte(0xa0);
respons();
write_byte(address/256);
respons();
write_byte(address%256);
respons();
write_byte(date);
respons();
stop();
}
uchar read_add(uint address)
{
uchar date;
start();
write_byte(0xa0);
respons();
write_byte(address/256);
respons();
write_byte(address%256);
respons();
start();
write_byte(0xa1);
respons();
date=read_byte();
stop();
return date;
}
我是這樣寫的,不知道對不對?