Giter VIP home page Giter VIP logo

objectbutton's People

Contributors

ales-svoboda avatar vzahradnik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

objectbutton's Issues

millis() counter overflow

millis() counter overflows after 50 days. We should compare a time difference from an absolute value. Tests should be written to cover this case.

Analog button auto-calibration mode

Add support for analog button/sensor auto-calibration mode. When program starts, user will be asked to press button 1..N. For each button we detect voltage level and set it as a button property.

At the moment, user needs to figure out these values by himself.

Add an example how to avoid class name collisions

M5stack library has a Button class, as does our library. To avoid name collisions, we've moved our library into jsc namespace. Under normal circumstances, it's ok to declare following line:

#include <...>
using namespace jsc;

However, when you include M5stack library and our library, it is important to keep our code inside jsc namespace to make a clear distinction between two Button classes. We should add an example how it should be done.

Note: ArduinoCI allows to specify dependencies only for selected examples. Only this example should have M5stack as a dependency. It's specified in a local .arduino-ci.yaml file.

Improve initialization with Builder pattern

Analog buttons will usually share the same pin. At the moment, we allow setting pin and inputPullUp flag for each button individually. This is not correct. Imagine that one button sets pin as inputPullUp and another sets the same pin to input only.

Builder pattern should solve this problem by not allowing to setup this flag on each individual button. Take into consideration memory restrictions.

Support for analog pins for multiple buttons

Is your feature request related to a problem? Please describe.
I wonder if this is possible to adapt your library to support multiple buttons in the same analog Pin.
Some other library implemented such design (https://github.com/rlogiacco/AnalogButtons), but doesn't handle the evens the way you do it and I wonder if there might be a way to do it using your library.

Describe the solution you'd like
Provide the ability to use an analog PIN, then allow a button to be configured with an activation value that triggers it (between 0 and 1024, based on the resistor associated with the button with a margin for resistor variance).

Additional context
I tried to do it myself but I'm clearly lacking knowledge... Do you think this can be done ?

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.