Created
June 5, 2021 10:01
-
-
Save systembolaget/3452b28550eefbbf4a8c45f5cf69252d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Wire.h> | |
const byte addressSlave = 7; | |
int rxValue; | |
void setup() | |
{ | |
Wire.begin(addressSlave); | |
Wire.onReceive(receiveEvent); | |
Serial.begin(115200); | |
} | |
void receiveEvent() | |
{ | |
rxValue = Wire.read(); | |
Serial.print("RX: "); Serial.println(rxValue); | |
} | |
void loop() | |
{ | |
// Later millis() timed WLAN and MQTT code for publishing to AIO | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment