GithubHelp home page GithubHelp logo

Comments (2)

nekitoss avatar nekitoss commented on August 15, 2024

Another idea is to create startOneTimeMeasure(), which will just start measure using already set (with validation) ONE_TIME mode, and, unlike conigure(), it won't be waiting 10ms to sensor receive command (if i understood corretly that delay in case someone tries to do something just right after), which will allow non-blocking flow

from bh1750.

coelner avatar coelner commented on August 15, 2024

I think this library will not get any further attention, maybe you should consider to fork and patch.

The sleep in general is not the problem, but most of the arduino devices doesn't restore their RAM. therefore the library needs to get initialized after every wakepup.
However, the instance of this library stores the last value and no, there is no getter for this currently:

unsigned long lastReadTimestamp;

this here:

// Wait a few moments to wake up
is because of the behavior of this chip, AFAIK it needs this time by itself. This value seems to work for most of the users, but feel free to look here: https://github.com/Starmbi/hp_BH1750/wiki/

As far as I remember you should be able to trigger a OneTime command, got to sleep the right amount of time and read then the sensor. The sensor itself stores the last measurement in the register until a new measurement is completed. (Need confirmation).
A get function for the wait delay could be useful, but is unlikely to happen.
On a battery driven design, you could sleep long enough to be sure that this chip is ready to deliver a new value (e.g. 500ms). If you want both, like maximum battery saving AND fastest refresh rate on hard timings, then this library is not useful.

from bh1750.

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.