Giter VIP home page Giter VIP logo

Comments (6)

sekdiy avatar sekdiy commented on August 26, 2024

This behaviour is by design, see #1 .

The reset functionality should not void total volume count, because a meter should be tamper proof.

If you want to reinitialize the meter, please do so by explicitly setting the values (see #1).

If you think that this should be improved, please give some context and insight.

from flowmeter.

AvinashPudale avatar AvinashPudale commented on August 26, 2024

void FlowMeter::reset() {
cli(); //!< going to change interrupt variable(s)
this->_currentPulses = 0; //!< reset pulse counter
sei(); //!< done changing interrupt variable(s)
this->_totalVolume = 0.0f; //just added this line now works as expected
this->_currentFrequency = 0.0f;
i added one line at above fuction now works as expected by me

from flowmeter.

sekdiy avatar sekdiy commented on August 26, 2024

Yes, as I mentioned above, this possibility was discussed in #1.

But do you think this is a feature that's missing in the library?
If so, why?

from flowmeter.

AvinashPudale avatar AvinashPudale commented on August 26, 2024

When we call reset() function in setup function it work like charm.
I use reset() function in loop with if statement ,to trigger relay on or off based on total volume despensed from trigger.
Then I use reset() function. Which reset all current volume not totalvalume.
Total volume count remains as privous value.

from flowmeter.

sekdiy avatar sekdiy commented on August 26, 2024

Actually, that's what current volume is intended for.

The difference between current volume and total volume is that the former is resettable, the latter is not.
This is by design.

If you intend to trigger a relay based on volume since last reset, isn't that current volume?
In other words: isn't your modification unifying current and total volumes, just making them identical all the time?

from flowmeter.

sekdiy avatar sekdiy commented on August 26, 2024

Closed due to inactivity.

from flowmeter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.