You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can get stable reading when Slave Address is < 0x40 with this code
void setup() {
pinMode(Rx, INPUT);
pinMode(Tx, OUTPUT);
mySerial.begin(9600);
TinyWireS.begin(I2C_SLAVE_ADDR);
TinyWireS.onRequest(requestEvent);
}
void requestEvent()
{
SendCount++; //increment this
switch (SendCount)
{
case 1:
sendByte = distLow;
break;
case 2:
sendByte = distHigh;
SendCount=0;
break;
}
TinyWireS.send(sendByte);
}
When Address is => 0x40 , its spitting garbage.
Wild guess:
Seems to be an issue with the write bit being the 7th bit (instead of 8)
The text was updated successfully, but these errors were encountered:
For a long period of time (about a year) I have been able to successfully use slave address 0x50 for a slave that only returned a single byte of data and did not receive anything (no receiveEvent defined).
Recently, I had the need to change the slave to return 3 bytes and receive a single byte. Changing the code broke the communication and it was only after several nights of frustration that I discovered this issue and gave changing the address (to 0x20) a try, which immediately fixed the problem.
For good measure, the slave is an AtTiny84 and the master an Adafruit Huzzah ESP8266 (not the Feather one).
I can get stable reading when Slave Address is < 0x40 with this code
void setup() {
pinMode(Rx, INPUT);
pinMode(Tx, OUTPUT);
mySerial.begin(9600);
TinyWireS.begin(I2C_SLAVE_ADDR);
TinyWireS.onRequest(requestEvent);
}
void requestEvent()
{
SendCount++; //increment this
switch (SendCount)
{
case 1:
sendByte = distLow;
break;
case 2:
sendByte = distHigh;
SendCount=0;
break;
}
TinyWireS.send(sendByte);
}
When Address is => 0x40 , its spitting garbage.
Wild guess:
Seems to be an issue with the write bit being the 7th bit (instead of 8)
The text was updated successfully, but these errors were encountered: