MicroPython Button Library - DIYables_MicroPython_Button
This MicroPython library is designed for any hardware plaform that supports MicroPython such as Raspberry Pi Pico, ESP32, Micro:bit... to make it easy to use push button, momentary switches, toggle switch, magnetic contact switch (door sensor)... It is easy to use for not only beginners but also experienced users...
It is created by DIYables to work with DIYables products, but also work with products from other brands. Please consider purchasing products from DIYables Store on Amazon from to support our work.
Features
- Works with any hardware plaform that supports MicroPython such as Raspberry Pi Pico, ESP32, Micro:bit...
- Supports the internal pull-up/pull-down resistor to avoid the floating value
- Supports debounce to eliminate the chattering phenomenon
- Supports the pressed and released events
- Supports the counting (for FALLING, RISING and BOTH)
- Easy to use with multiple buttons
- All functions are non-blocking
Available Functions
- __init__(pin, mode=Pin.PULL_UP)
- set_debounce_time(time_ms)
- get_state()
- get_state_raw()
- is_pressed()
- is_released()
- set_count_mode(mode)
- get_count()
- reset_count()
- loop()
Available Examples
- pull_up.py
- pull_down.py
Tutorials
References
Metadata
Release files for DIYables-MicroPython-Button 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| diyables_micropython_button-0.1.0.tar.gz | 4.3 kB | Without provenance | Details for diyables_micropython_button-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| DIYables_MicroPython_Button-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for DIYables_MicroPython_Button-0.1.0-py3-none-any.whl |
Total release size: 9.6 kB
Release files / DIYables_MicroPython_Button-0.1.0-py3-none-any.whl
| Download URL | DIYables_MicroPython_Button-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a67453f3b44aa25cf5423cb12d3c15903b9f280d392c1e7c56f25b5d7d5e4f50
|
|
BLAKE2b-256 checksum How to use checksums |
de36251eaaa307f45ea80561362259def9df0f7733958f6e6ed20dfe25725070
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Security for DIYables-MicroPython-Button 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.