Index: trunk/Arduino/projects/OT_boiler/OT_boiler.ino
===================================================================
--- trunk/Arduino/projects/OT_boiler/OT_boiler.ino	(revision 19)
+++ trunk/Arduino/projects/OT_boiler/OT_boiler.ino	(revision 21)
@@ -21,5 +21,17 @@
 volatile bool  _connected = false;
 
-OT_Slave	boiler;
+class OT_Boiler : public OT_Slave {
+
+protected:
+	int		a2;
+
+public:
+	virtual float	GetBoilerTemperature ();
+	virtual float	GetReturnTemperature ();
+
+friend void loop();
+};
+
+OT_Boiler	boiler;
 
 EthernetClient	client;
@@ -83,22 +95,9 @@
   unsigned long periode = msTicks / (boiler.IsActive() ? 500 : 2000);
   static unsigned long prev = 0;
-
-  int a2 = analogRead(A2);   // read the input pin
-#ifdef _R9_22K_
-  const double m = 0.1309;
-  const double b = -9.4535;
-#elif defined(_R9_15K_1_)
-  const double m = 0.1746;
-  const double b = -13.164;
-#else
-  const double m = 0.1848;
-  const double b = (-12.936 - 5.5);
-#endif
-  double ta2 = m*double(a2)+b;
-  
   if (prev != periode) {
 	  prev = periode;
 	  int led = (periode & 1) ? HIGH : LOW;
 	  if (Serial) {
+		  float tBoiler = boiler.GetBoilerTemperature();
 		  Serial.print("Time: ");
 		  Serial.print(msTicks);
@@ -107,8 +106,8 @@
 		  Serial.print("\tLED: ");
 		  Serial.print(led);
-      Serial.print("\tA2: ");
-      Serial.print(a2);
-      Serial.print("\tT(A2): ");
-      Serial.println(ta2);
+		  Serial.print("\tA2: ");
+		  Serial.print(boiler.a2);
+		  Serial.print("\tT(A2): ");
+		  Serial.println(tBoiler);
 	  }
 	  digitalWrite(ACTIVITY_LED_PIN, led);
@@ -179,2 +178,16 @@
   }
 }
+
+float OT_Boiler::GetBoilerTemperature ()
+{
+	a2 = analogRead(A2);   // read the input pin
+	const double m = 0.1848;
+	const double b = -17.4056;
+	tBoiler = double(m*double(a2)+b);
+	return tBoiler;
+}
+
+float OT_Boiler::GetReturnTemperature ()
+{
+	return OT_Slave::GetReturnTemperature ();
+}
