Joy-it RB-P-XPLR-SET handleiding

37 pagina's
PDF beschikbaar

Handleiding

Je bekijkt pagina 28 van 37
28
from machine import Pin
import utime
# Initialize the LEDs
red_led = Pin(18, Pin.OUT)
yellow_led = Pin(17, Pin.OUT)
green_led = Pin(16, Pin.OUT)
# Flashing function for one LED
def blink_led(led, duration):
led.value(1) # Switch on LED
utime.sleep(duration)
led.value(0) # Switch o LED
utime.sleep(duration)
# Hauptschleife
while True:
blink_led(red_led, 0.5) # Red LED ashes for 0.5 seconds
blink_led(yellow_led, 0.5) # Yellow LED ashes for 0.5 seconds
blink_led(green_led, 0.5) # Green LED ashes for 0.5 seconds
SUMMARY: We control three dierent LEDs via the pins of the Raspberry Pi Pico, with each LED flashing alternately.
Initialization of the LEDs
LED flashing function
Main loop

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