MCPcopy Create free account
hub / github.com/DanielOgorchock/ST_Anything / addSensor

Method addSensor

Arduino/libraries/ST_Anything/Everything.cpp:257–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255 }
256
257 bool Everything::addSensor(Sensor *sensor)
258 {
259 if(m_nSensorCount>=Constants::MAX_SENSOR_COUNT)
260 {
261 if(debug)
262 {
263 Serial.print(F("Did not add sensor named "));
264 Serial.print(sensor->getName());
265 Serial.println(F("(You've exceeded maximum number of sensors; edit Constants.h)"));
266 }
267 return false;
268 }
269 else
270 {
271 m_Sensors[m_nSensorCount]=sensor;
272 ++m_nSensorCount;
273 }
274
275 if(debug)
276 {
277 Serial.print(F("Everything: adding sensor named "));
278 Serial.println(sensor->getName());
279 Serial.print(F("Everything: Free RAM = "));
280 Serial.println(freeRam());
281 }
282 return true;
283 }
284
285 bool Everything::addExecutor(Executor *executor)
286 {

Callers

nothing calls this directly

Calls 4

freeRamFunction · 0.85
printMethod · 0.80
getNameMethod · 0.80
printlnMethod · 0.80

Tested by

no test coverage detected