Has anyone managed to talk to one using the built in library? I'm at a loss.
This stores that text somewhere but I'm not sure where. It does not persist after power cycle.
//not working despite the title
#include <Wire.h>int x=0;
char c;void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
Serial.begin(9600); // start serial for output
}void loop()
{
if (x == 0){
Wire.beginTransmission(0xA0); // transmit to device #4
Wire.send(0);
Wire.send("you are such a goober");
Wire.endTransmission(); // stop transmitting
Serial.println(x);
}x = 1;
Wire.beginTransmission(0xA0);
Wire.send(0);
Wire.endTransmission();//Wire.beginTransmission(0xA1);
Wire.requestFrom(0xA1, 22); // request bytes from slave devicewhile(Wire.available()) // slave may send less than requested
{
c = Wire.receive(); // receive a byte as character
Serial.print(c); // print the character
}
Serial.println(" EOL ");
Wire.endTransmission();
c = NULL;
delay(500);
}