Joy-it RB-P-XPLR-SET handleiding

37 pagina's
PDF beschikbaar

Handleiding

Je bekijkt pagina 8 van 37
4.2 RGB LEDS
RGB LEDs are a type of light-emitting diode that combines red, green and blue to produce a variety of colors. Much like a buzzer only produces simple
tones, RGB LEDs cannot display complex images, but they are excellent at mixing and varying colors. Each LED in an RGB unit can be varied in intensity to
produce dierent hues, from so pastels to bright, saturated colors. This makes them ideal for mood lighting, decorative lighting and in applications where
visual signals are required, such as in gaming setups or as status indicators in electronic devices. Their versatility and energy eiciency have made them a
popular choice in modern lighting systems, although, like the buzzer, their simple operation means they cannot create complex images or patterns without
additional control units.
The GPIO LEDs are connected to the GPIO pin GP1.
# Load libraries
from machine import Pin, PWM
from utime import sleep
from neopixel import NeoPixel
ledPin = 1
ledCount = 4
# Initialize GPIOs
led = Pin(ledPin, Pin.OUT)
led = NeoPixel(Pin(ledPin, Pin.OUT), ledCount)
while True:
# Turn LEDs white
for i in range (ledCount):
led[i] = (255, 255, 255)
led.write()
sleep(1)
# Turn LEDs red
for i in range (ledCount):
led[i] = (255, 0, 0)
led.write()
sleep(1)
# Turn LEDs blue
for i in range (ledCount):
led[i] = (0, 0, 255)
led.write()
sleep(1)
# Turn LEDs green
for i in range (ledCount):
led[i] = (0, 255, 0)
led.write()
sleep(1)
8

Bekijk gratis de handleiding van Joy-it RB-P-XPLR-SET, stel vragen en lees de antwoorden op veelvoorkomende problemen, of gebruik onze assistent om sneller informatie in de handleiding te vinden of uitleg te krijgen over specifieke functies.

Productinformatie

MerkJoy-it
ModelRB-P-XPLR-SET
CategorieNiet gecategoriseerd
TaalNederlands
Grootte21690 MB