Changeset 25 for trunk/Arduino/projects/OT_boiler/OT_boiler.ino
- Timestamp:
- Sep 27, 2019, 9:39:31 AM (7 years ago)
- File:
-
- 1 edited
-
trunk/Arduino/projects/OT_boiler/OT_boiler.ino (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Arduino/projects/OT_boiler/OT_boiler.ino
r21 r25 25 25 protected: 26 26 int a2; 27 int a3; 28 int a4; 29 30 virtual double AD2Temperature (int); 27 31 28 32 public: … … 99 103 int led = (periode & 1) ? HIGH : LOW; 100 104 if (Serial) { 101 float tBoiler = boiler.GetBoilerTemperature();102 105 Serial.print("Time: "); 103 106 Serial.print(msTicks); … … 106 109 Serial.print("\tLED: "); 107 110 Serial.print(led); 111 float tBoiler = boiler.GetBoilerTemperature(); 108 112 Serial.print("\tA2: "); 109 113 Serial.print(boiler.a2); 110 114 Serial.print("\tT(A2): "); 111 Serial.println(tBoiler); 115 Serial.print(tBoiler); 116 float tReturn = boiler.GetReturnTemperature(); 117 Serial.print("\tA3: "); 118 Serial.print(boiler.a3); 119 Serial.print("\tT(A3): "); 120 Serial.println(tReturn); 112 121 } 113 122 digitalWrite(ACTIVITY_LED_PIN, led); … … 179 188 } 180 189 190 double OT_Boiler::AD2Temperature (int x) 191 { 192 const double m = 0.2059; 193 const double b = -27.951; 194 return m*double(x)+b; 195 } 196 181 197 float OT_Boiler::GetBoilerTemperature () 182 198 { 183 199 a2 = analogRead(A2); // read the input pin 184 const double m = 0.1848; 185 const double b = -17.4056; 186 tBoiler = double(m*double(a2)+b); 200 tBoiler = AD2Temperature(a2); 187 201 return tBoiler; 188 202 } … … 190 204 float OT_Boiler::GetReturnTemperature () 191 205 { 192 return OT_Slave::GetReturnTemperature (); 193 } 206 a3 = analogRead(A3); // read the input pin 207 tReturn = AD2Temperature(a3); 208 return tReturn; 209 }
Note: See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/trac/Paradigma/chrome/site/paradigma.png)