Skip to main content

MicroPython LED Library - DIYables_MicroPython_LED

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 control LED. 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

  • Turn on/off
  • Toggle between on and off
  • Fade in/out
  • Blink
  • Blink with the number of times
  • Blink in a period of time
  • Cancel the blinking or fading anytime
  • Support both control modes: CTRL_ANODE and CTRL_CATHODE
  • Get the on/off LED's states: LED_OFF, LED_ON
  • Get the operation LED's state: LED_IDLE, LED_DELAY, LED_FADING, LED_BLINKING
  • All functions are non-blocking (without using delay() function)
  • Easy to use with multiple LEDs

Available Functions

  • __init__(pin, mode)
  • turn_on(delay_time=0)
  • turn_off(delay_time=0)
  • toggle(delay_time=0)
  • fade(fade_from, fade_to, fade_time, delay_time=0)
  • blink(on_time, off_time, delay_time=0)
  • blink_with_duration(on_time, off_time, blink_time, delay_time=0)
  • blink_n_times(on_time, off_time, number_of_times, delay_time=0)
  • cancel()
  • get_on_off()
  • get_state()
  • loop()

Available Examples

  • led_blink.py
  • led_fade.py
  • led_on_off.py
  • led_toggle.py
  • led_multiple.py
  • led_blink_n_times.py
  • led_blink_with_duration.py
  • led_array.py

Tutorials

References

Metadata

Release files for DIYables-MicroPython-LED 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-MicroPython-LED 0.1.1
File Size Uploaded Provenance Actions
diyables_micropython_led-0.1.1.tar.gz 6.9 kB Without provenance Details for diyables_micropython_led-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for DIYables-MicroPython-LED 0.1.1
File Interpreter ABI Platform Actions
DIYables_MicroPython_LED-0.1.1-py3-none-any.whl Python 3 none any Details for DIYables_MicroPython_LED-0.1.1-py3-none-any.whl

Total release size: 13.1 kB

Release files / diyables_micropython_led-0.1.1.tar.gz

Download URL diyables_micropython_led-0.1.1.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
cf92db2f62e16121f59a821e5a27bbd82afef78cca6a7b369a62a7fb620d052d
BLAKE2b-256 checksum
How to use checksums
6a45559e8b2312578e44f5266686d18c05dbece310bb7a8cbe44438abcf70f58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

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

Download URL DIYables_MicroPython_LED-0.1.1-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d220504e93be65c369a490a625d24a9ad85e8896eda9f019513172108a9f5189
BLAKE2b-256 checksum
How to use checksums
7756bc2505c6a3da9c50a66bfa80acc46d96233a45a4b6fee1d94a10522e990c
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-LED 0.1.1

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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