//Wired Slave
#include <Wire.h>
int LED = D7;
void setup() {
pinMode(LED,OUTPUT);
Wire.begin(8); //Address of wired slave
Wire.onReceive(info);
Serial.begin(9600); //Initializes serial communication
}
void loop() {
//A slave doesn't need a loop, just a function to receive information
}
void info(int hey){
while(Wire.available()){ //Works when there is information sent
char L = Wire.read(); //Reads the information sent, info sent as written, not numbers
if(L == '1'){
digitalWrite(LED, HIGH);
}else{
digitalWrite(LED, LOW);
}}}