Skip to main content

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

Release files for DIYables-Pico-Button 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for DIYables-Pico-Button 0.1.1
File Size Uploaded
diyables_pico_button-0.1.1.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for DIYables-Pico-Button 0.1.1
File Interpreter ABI Platform
DIYables_Pico_Button-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 9.2 kB

Release files / diyables_pico_button-0.1.1.tar.gz

Download URL diyables_pico_button-0.1.1.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e8373bf28650863edabc2e5786ad53612d6846277e8746013ff5fba0c62263a7
BLAKE2b-256 checksum
How to use checksums
5b4a585f62969fc8fdd40a7f11c92d3af34770717ae6923732a58d33725b2e79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / DIYables_Pico_Button-0.1.1-py3-none-any.whl

Download URL DIYables_Pico_Button-0.1.1-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d920e2ff3efb99325f420062c22a3b15bcee88c3b8683e5064b76dfd4999d124
BLAKE2b-256 checksum
How to use checksums
34b87438d652748122fb52c69f23f3ab744a834b338a72f24da0629849bbf37a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page