/* * main.cpp * * Created on: 10.01.2011 * Author: Christian Mikula */ #include "avr/io.h" #include "math.h" #define R1 10000 #define R0 10000 #define T0 298.15 #define B 3380 #define ZeroTemp 273.15 float get_temp(float Rth) { float T = B / (log(Rth / (R0 * exp(-B / T0)))); return T - ZeroTemp; } int main(void) { double x = 1234; while (1) { x = get_temp(x); } return 0; }