I've been working on my coffee roasting profile sketch for quite some time. I'm using an Arduino with 2 thermocouples(TC) sending temperature data to my PC, and use Processing to graph and display the temp.
Unfortunately when one TC is exposed to the high heat and one is not, they seem to be effecting one another. When heat is applied to one TC the other temp begins to increase as well, which in turn seems to be subtracting from the heated TC temp reading. Does that make sense? Basically, if I know the non heated TC should read 55*F, it might read 75*F. While the heated TC should read 390*F but instead reads 370*F. So obviously its getting mixed messages.
Here is the code for my commPort read.
Code:if ((currentPoint < numberOfGraphPoints)
&& (millis() - previousGrabTime >= timeStep)
&& (commPort.available() > 2)
&& (commPort.read() == 255)){
// if it's time to grab, the array is not full, AND the commport is available...
tempC = commPort.read();
tempB = commPort.read();
tempF = ((tempC * 9) / 5) + 32;
// converts tempC to Fahrenheit
tempEnvF = ((tempB*9)/5) + 32;
I'm thinking this may be my error, with both tempC and tempB equaling commPort.read() . The arduino sends the data as tempC and tempB. While the sketch displays tempF and tempEnvF .
Is there a way to code the commPort.read 's in a way where processing wont confuse the two, if this is in fact my problem?