Changeset 17 for trunk/Arduino
- Timestamp:
- Sep 5, 2019, 8:08:29 AM (7 years ago)
- Location:
- trunk/Arduino/libraries/OT_Slave
- Files:
-
- 2 edited
-
OT_Slave.cpp (modified) (8 diffs)
-
OT_Slave.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Arduino/libraries/OT_Slave/OT_Slave.cpp
r16 r17 32 32 dhwTemperature(0), 33 33 tBoiler(28.0), 34 tRet (28.0)34 tReturn(28.0) 35 35 { 36 36 } … … 40 40 pinMode(THERMOSTAT_IN, INPUT); 41 41 digitalWrite(THERMOSTAT_OUT, HIGH); 42 pinMode(THERMOSTAT_OUT, OUTPUT); // low output = high current, high output = low current42 pinMode(THERMOSTAT_OUT, OUTPUT); // low output = high current, high output = low current 43 43 cbAction = cb; 44 digitalWrite(LED_BUILTIN, LOW); // Built-in LED off 45 pinMode(LED_BUILTIN, OUTPUT); 44 46 } 45 47 … … 164 166 chEnable = enable; 165 167 chActive = enable; 168 digitalWrite(LED_BUILTIN, IsActive() ? HIGH : LOW); // Built-in LED on/off 166 169 return chEnable; 167 170 } … … 171 174 chEnable = false; 172 175 chActive = false; 176 digitalWrite(LED_BUILTIN, IsActive() ? HIGH : LOW); // Built-in LED on/off 173 177 return chEnable; 174 178 } … … 183 187 dhwEnable = enable; 184 188 dhwActive = enable; 189 digitalWrite(LED_BUILTIN, IsActive() ? HIGH : LOW); // Built-in LED on/off 185 190 return dhwEnable; 186 191 } … … 190 195 dhwEnable = false; 191 196 dhwActive = false; 197 digitalWrite(LED_BUILTIN, IsActive() ? HIGH : LOW); // Built-in LED on/off 192 198 return dhwEnable; 193 199 } … … 198 204 } 199 205 206 bool OT_Slave::IsActive () 207 { 208 return (chActive || dhwActive); 209 } 210 200 211 float OT_Slave::GetBoilerTemperature () 201 212 { 202 if ( chActive || dhwActive) {213 if (IsActive()) { 203 214 // increase 204 215 float tTarget = (chTemperature > dhwTemperature) ? chTemperature : dhwTemperature; 205 216 if (tBoiler < tTarget) { 206 tBoiler += 0.01;217 tBoiler = (tBoiler + 2.0 * tTarget) / 3.0; 207 218 } 208 219 } else { 209 220 // decrease 210 if (tBoiler > tRet ) {211 tBoiler -= 0.01;221 if (tBoiler > tReturn) { 222 tBoiler = (tBoiler + 2.0 * tReturn) / 3.0; 212 223 } 213 224 } … … 219 230 float OT_Slave::GetReturnTemperature () 220 231 { 221 float temp = 100.0 * (tRet - 1);232 float temp = 100.0 * (tReturn - 1); 222 233 temp += float((loops >> 4) % 100); 223 234 return temp / 100.0; -
trunk/Arduino/libraries/OT_Slave/OT_Slave.h
r15 r17 30 30 float dhwTemperature; 31 31 32 float tBoiler; // max(ch,dhw,ret )33 float tRet ;// Troom (28.0)32 float tBoiler; // max(ch,dhw,return) 33 float tReturn; // Troom (28.0) 34 34 35 35 public: … … 51 51 virtual void DHW_Temperature (float); 52 52 53 virtual bool IsActive (); 54 53 55 virtual float GetBoilerTemperature (); 54 56 virtual float GetReturnTemperature ();
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)