I have touchscreen EEPROM controller FT5316 with i2c slave mode interface.
According to specification, first I need to send 6bit address, then 7th bit - r/w flag.
I found simple way to read data from slave device by this code:
#include <Wire.h>
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
Serial.begin(9600); // start serial for output
}
int i=56;
void loop()
{
//Serial.print(i);
//Serial.print(": ");
Wire.requestFrom(i, 64); // request 64 bytes from slave device
int r=0;
while(Wire.available()) // slave may send less than requested
{
r++;
char c = Wire.read(); // receive a byte as character
Serial.print(c,HEX); // print the character
}
if(r>0)Serial.println(" ");
delay(1000);
}
There 56 - address found by iteration over 0..n
And by this code I get only 16bytes, which is zeroes.
Does this real data, or I doing something wrong?
Best regards, Mikhail.