from machine import Pin
import time
print("Hello, Pi Pico!")
ledR = Pin(0, Pin.OUT)
ledB = Pin(1, Pin.OUT)
cnt = int(input('How many counts?'))
for i in range(cnt):
print(i+1, '회')
ledR.value(1)
ledB.value(0)
time.sleep(1)
ledR.value(0)
ledB.value(1)
time.sleep(1)
# 5mm LED 1.8v / 20mA data sheet
# 3.3v 사용 시 저항이 그렇게까지는 필요하지 않으나
# 5v 사용 할 때는 저항 사용이 필요하다!
Loading
pi-pico-w
pi-pico-w