Hello,
It's basically the slave_receiver example, just modified to show the byte value in hex.
#include <Wire.h>
void setup()
{
Wire.begin(0x55);
Wire.onReceive(receiveEvent); // register event
Serial.begin(19200); // start serial for output
Serial.println("receive test");
}
void loop()
{
delay(100);
}
// function that executes whenever data is received from master
// this function is registered as an event, see setup()
void receiveEvent(int howMany)
{
while(1 < Wire.available()) // loop through all but the last
{
char c = Wire.receive(); // receive byte as a character
Serial.println(c, HEX); // print the character
}
int x = Wire.receive(); // receive byte as an integer
Serial.println(x, HEX); // print the integer
}
I can try to capture of the iPort waveforms also, to show that it outputs correctly. We've used this device extensively with no problems, but a second check never hurts ...