Skip to main content

Button Library for with Raspberry Pi Pico, created by DIYables

Project description

Button Library for Raspberry Pi Pico - DIYables_Pico_Button

This MicroPython library is designed for Raspberry Pi Pico 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 Raspberry Pi Pico board.
  • 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diyables_pico_button-0.1.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

DIYables_Pico_Button-0.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file diyables_pico_button-0.1.0.tar.gz.

File metadata

  • Download URL: diyables_pico_button-0.1.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for diyables_pico_button-0.1.0.tar.gz
Algorithm Hash digest
SHA256 957984d83127732bc0455721bc8cc44e3b2f34a6ad64109ef8a7714b00a5685a
MD5 6e14df247a683de71648567727662253
BLAKE2b-256 6e5828efac2e1a823b223014cdd321c2828df047a2ab9548c2277866324da56a

See more details on using hashes here.

File details

Details for the file DIYables_Pico_Button-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for DIYables_Pico_Button-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ea484eb1786c5a4cfc53db93470ac5880078258432e38b249a33abe98f97bcc8
MD5 395f19d8f4729f2e845cc6fa34fe0642
BLAKE2b-256 fe227d1d860cec46c419e2c10a095428f2c5ab3a3ff2979bf57f2529fded4860

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page