I'm hoping to track cows' feed consumption throughout the day by using an RFID tag and a load cell to measure difference in weight of the trough i.e. feed consumed. I use OOC (coming from Java, OOC in cpp is new to me) to create cow objects with private variables RFID and a vectorconsumption (with their total feed consumption (a float variable) push_back into the vector after each individual session i.e. time between when RFID is first detected and its absence is first detected).
The problem is that, after a feeding session, the vector consumption appears to be empty when I test it in the main loop(); but not inside my class functions. I have no idea what is going on, because I can successfully push_back to my cow object's vector consumption with a float in both the main loop() and in the class functions when I do it explicitly.
Any guidance would be much, much appreciated, I'm just banging my head on my desk at this point and am desperate for any drop of wisdom from the teats of the Arduino forum.
Serial.println(Ozwald.getConsumption().empty()); in main loop() test results in 1; whereas
Serial.println(it->getConsumption().empty()); in my class function report() test results in 0.