Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4465

Português • Lesson 2: Breathing Light

$
0
0
ola a todos comprei a uns dias o Elecrow Raspberry Pi Pico Advanced Kit with 32 Modules and 32 Projects Lessons mas nao estou a conseguir ligar o segundo projeto em que este é o código:
from machine import Pin, PWM
import utime
led = PWM(Pin(2))
led.freq(1000) # Set the frequency value
led_value = 0 #LED brightness initial value
led_speed = 5 # Change brightness in increments of 5
if __name__ == '__main__':
while True:
led_value += led_speed
led.duty_u16(int(led_value * 500)) # Set the duty cycle, between 0-65535
utime.sleep_ms(100)
if led_value >= 100:
led_value = 100
led_speed = -5
elif led_value <= 0:
led_value = 0
led_speed = 5
isto tmb nao me parece mt bem mas queria ajuda a montar o projeto ja consegui ligar o led(ou seja nao é problema do led ou da montagem acho) mas de outra forma, quem preceber disto e poder me ajudar diga o contacto insta ou assim para podermos falar pff e obg.
projeto 2.png

WhatsApp Image 2024-07-13 at 23.06.33.jpeg

Statistics: Posted by Cristiano Lino — Sat Jul 13, 2024 11:22 pm — Replies 0 — Views 13



Viewing all articles
Browse latest Browse all 4465

Trending Articles