When I'm trying to send something via send() to Master device directly from the main loop it doesn't work(slave just stops working. I know it has something to do with a buffer). Moreover onReceive event also doesn't work
I'm using Attiny45@8MHz (int. osc.) as a slave and Arduino Uno as master.
And a little bit of code for slave:
#include "TinyWireS.h"
void setup() {
TinyWireS.begin(0x26);
TinyWireS.onReceive(tester);
}
void loop() {
}
void tester (byte zzz){
PORTB ^= _BV(4);
}
And for master:
#include
void setup()
{
Wire.begin();
}
void loop()
{
Wire.beginTransmission(0x26);
Wire.write(B11111111);
Wire.endTransmission();
}
Any Idea what Am I doing wrong?