Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timed based buffer #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Timed based buffer #5

wants to merge 2 commits into from

Conversation

oferreiro
Copy link

@oferreiro oferreiro commented Feb 2, 2019

I had some problems to use your library with PJON and some buttons. Mostly if it use large READINGS_NUMBER.
So, it is a implementation of timed buffer to store analog reads.
It avoid use of delay in read routines and free micro controller to do another tasks.

store analog port timed readings, instead of delay interruptions.

  public:
    Update
    isReading
    setUseDelay
    startRead
  private:
    initBuffer
    readBuffer

Added variables
    bool useDelay;
    double *analogBuffer;
    unsigned int bufferId;
    long lastRead;
    bool enableRead;

Added constructor to set delay or buffer option.
Added example to use this library without delay() interruptions.
Updated keywords.txt.
Removed unused volatile variables (it does not use interrupts).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant