I am currently receiving data from another Arduino via I2C/Wire library and I would like to use the received data in a different function. (a function to transmit the bytes I receive via LoRa)
void receiveEvent() {
byte x = Wire.read();
Serial.print(char(x));
}
How can I access byte x from this function? I have already tried to use byte as a return type, but since I have declared:
Wire.begin(8); // join i2c bus
Wire.onReceive(receiveEvent);