0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

電子工作メモ - LEDバー

Last updated at Posted at 2024-03-21
from machine import Pin
import time

pins = [16, 17, 18, 19, 20, 21, 22, 26, 27, 28]

flowlightPins = pins + reversed(pins)
def showFlowLight():
    global flowlightPins
    for pin in flowlightPins:
        showLed(pin)

def showLed(pin):
    print(pin)
    led = Pin(pin, Pin.OUT)
    led.value(1)
    time.sleep_ms(100)
    led.value(0)
    time.sleep_ms(100)

while True:
    showFlowLight()
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?