#include const int rx=1; const int tx=2; const int tpin=3; SoftwareSerial mySerial(rx,tx); void setup() { mySerial.begin(9600); } void loop() { int t; t=analogRead(tpin); float tc=calcT(t); mySerial.println(tc); } float calcT(int data) { float B=3750; float T0=298.15; float R0=10000.0; float R1=11200.0; float rr1,t; rr1= R1 * data / (1024.0 - data); t = 1 / (log(rr1 / R0) / B + (1 / T0)); return (float)(t - 273.15); }