LM35 problem

tempC = commPort.read();

read() returns a number between 0 and 255 for the next byte that's waiting in the buffer..

So you will not get your temperature in the integer or float format.. You will get the first byte coming from the serial only..

..my temp returns as 50 degrees C

You got the number 50 - in the ASCII it means "2" - that is the first char (first byte) of your temperature sent as string "22" :wink:

You may try (maybe it works with processing) provided your temperature has been sent as an integer:

if (commPort.available()>0) {
tempC = (float)(commPort.parseInt());
}

or

if (commPort.available()>0) {
tempC = commPort.parseFloat();
}

when sent as a float.