MicroPython Library for blinking and fading LED, created by DIYables
Project description
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
- Raspberry Pi Pico - Blink LED
- Raspberry Pi Pico - Blink LED without Sleep
- Raspberry Pi Pico - Fade LED
References
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file diyables_micropython_led-0.1.0.tar.gz
.
File metadata
- Download URL: diyables_micropython_led-0.1.0.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e5f5f77bd0147a335928dfca3810912c38a9bbe4cc80f7760dee4560be3cec9 |
|
MD5 | 03628945d3c0a24c56b9a793541adaf8 |
|
BLAKE2b-256 | 55fbf35f987e62971605f7700d6fed8c62b32d087f9fb721bb4998928d63f4ee |
File details
Details for the file DIYables_MicroPython_LED-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: DIYables_MicroPython_LED-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d8cff547028a49f45167084d9ce158f43f933cbc48ce5e2bffcdbf87ec56917 |
|
MD5 | 3f457583fabe67c1f8658b95422a8318 |
|
BLAKE2b-256 | c661ad53fbf0daae8d7e202fddb2e7ef163215189f62eed017a315fc116179f7 |