Skip to content

How to use a LedLab led object

jim edited this page Apr 10, 2026 · 1 revision

You can use lots of methods of this library on a LED object. Here is a list of all of them and what do they do:

Name (And Arguments) Use
test_led.on() Turns on the LED
test_led.off() Turns the LED off
test_led.blink(how many times to blink, the delay in between) Make the LED turn on and off with a delay for a specified duration
test_led.is_active Returns False if the LED is off and True if it's on
test_led.toggle() If the LED is on it turns it off and vice versa

The following methods are not for a LedLab object, but for the LedLab class.

Name (And Arguments) Use
LedLab.get_available_leds() It prints all of the defined LEDs
LedLab.get_led_by_name(LED name: string) It's like defining a LED but by its name not its pin

NOTE: Find examples at the USAGE_EXAMPLE.py file in this repository or download it from the latest release

Clone this wiki locally