Sara91:
the board keeps executing the previous code where i was trying to get the temp in Celsius,i get the following in the msg box but i'm not sure is it's related in any way!:
" avrdude: stk500_getsync(): not in sync: resp=0x31 "
That error means that your upload is failing. That is why the previous sketch is executing.
http://arduino.cc/en/Main/arduinoBoardLeonardo
"Because of the way the Leonardo handles reset it's best to let the Arduino software try to initiate the reset before uploading, especially if you are in the habit of pressing the reset button before uploading on other boards. If the software can't reset the board you can always start the bootloader by pressing the reset button on the board."