Διευθυνσιοδοτούμενη λυχνία LED#
Εισαγωγή#
Μια διευθυνσιοδοτούμενη λυχνία LED είναι μια προγραμματιζόμενη συσκευή ταινίας LED RGB που συνδέεται σε μια θύρα 3 καλωδίων και σας επιτρέπει να ελέγχετε μεμονωμένες λυχνίες LED (όπως WS2812/στυλ «NeoPixel») για την εμφάνιση προσαρμοσμένων χρωμάτων και μοτίβων.
This page uses address_led as the example Addressable LED’s name. Replace it with your own configured name as needed.
Παρακάτω είναι μια λίστα με τις διαθέσιμες μεθόδους:
Constructor – Μη αυτόματη αρχικοποίηση και διαμόρφωση μιας διευθυνσιοδοτούμενης λυχνίας LED.
AddressableLed– Create an Addressable LED.
set#
set sets the Addressable LED strip to provided values.
Usage:
address_led.set(data, offset)
Παράμετροι |
Περιγραφή |
|---|---|
|
A |
|
Προαιρετικό. Ο δείκτης της LED από τον οποίο θα ξεκινήσει, ξεκινώντας από το 0. |
# 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()
Παράμετροι |
Περιγραφή |
|---|---|
Αυτή η μέθοδος δεν έχει παραμέτρους. |
Κατασκευαστής#
Constructors are used to create AddressableLed objects, which are necessary for configuring an Addressable LED.
AddressableLed#
AddressableLed creates an Addressable LED.
Usage:
AddressableLed(port)
Παράμετρος |
Περιγραφή |
|---|---|
|
The 3-Wire Port that the Addressable LED strip is connected to:
|
# Create an Addressable LED in Port A
address_led = AddressableLed(brain.three_wire_port.a)