LED direccionable#

Introducción#

Un LED direccionable es un dispositivo de tira LED RGB programable que se conecta a un puerto de 3 cables y le permite controlar LED individuales (como el estilo WS2812/“NeoPixel”) para mostrar colores y patrones personalizados.

This page uses address_led as the example Addressable LED’s name. Replace it with your own configured name as needed.

A continuación se muestra una lista de los métodos disponibles:

  • set – Sets the Addressable LED strip’s colors.

  • clear – Turns the whole Addressable LED strip off.

Constructor: inicializa y configura manualmente un LED direccionable.

set#

set sets the Addressable LED strip to provided values.

Usage:
address_led.set(data, offset)

Parámetros

Descripción

data

A list of Color values. This includes predefined colors, hexadecimal integers, and web colors.

offset

Opcional. El índice del LED donde se iniciará.

# Create a sequence of colors: Red, Green, Blue
color_list = [Color(0xFF0000), Color(0x00FF00), Color(0x0000FF)]

# Set the Addressable LED to the color_list sequence
address_led.set(color_list)

clear#

clear turns the whole Addressable LED strip off.

Usage:
address_led.clear()

Parámetros

Descripción

Este método no tiene parámetros.

Constructor#

Constructors are used to create AddressableLed objects, which are necessary for configuring an Addressable LED.

AddressableLed#

AddressableLed creates an Addressable LED.

Usage:
AddressableLed(port)

Parámetro

Descripción

port

The 3-Wire Port that the Addressable LED strip is connected to:

  • On the V5 Brainbrain.three_wire_port.x where x is the number of the port.
  • On a 3-Wire Expanderexpander.a where expander is the name of the expander instance.

# Create an Addressable LED in Port A
address_led = AddressableLed(brain.three_wire_port.a)