I2C Communication Help

Hello,

I have 2 Arduinos. One will rotate a motor 60 deg once a laser is tripped. One will read a temperature and turn a power supply on and off with a solid state relay depending on the current temperature. I've been playing around with the Wire library tutorials, but I can't seem to get it to work. My goal is to tell arduino one to store the current temperature once the laser from arduino two has tripped for data collecting purposes. The programming logic would look something like the code below. I'm using two elegoo uno R3s and the temperature sensor is a k Type thermocouple from Omega using a MAX31850 as a cold junction. Anyone have any advice? Also, if anyone knows the command to retrieve the current temperature at the time of retrieval and save it as an integer using the dallastemp library?

[MASTER ARDUINO]
if digitalRead(LASER, LOW);
{ 
Wire.send(*** some sort of save temperature function ***);

** or **

Wire.write( " " );
}


[SLAVE ARDUINO]
while (Wire.available())
{ if ...

{
Wire.read( *** command from Master *** );

*** Save current temperature and store it ***
}
}

jmcmahan:
the temperature sensor is a k Type thermocouple from Omega using a MAX31850 as a cold junction. Anyone have any advice? Also, if anyone knows the command to retrieve the current temperature at the time of retrieval and save it as an integer using the dallastemp library?

The dallastemp library would be for the Dallas Semiconductor (now Maxim) DS18B20 OneWire sensors. You need a library for the Maxim MAX31850 chip. Try Google: MAX31850 Arduino library