parent
d66b9e5f21
commit
6b0c58ac6e
|
|
@ -1,24 +1,37 @@
|
||||||
Adafruit-Blinka==8.62.0
|
Adafruit-Blinka==8.67.0
|
||||||
adafruit-circuitpython-busdevice==5.2.13
|
adafruit-circuitpython-busdevice==5.2.14
|
||||||
adafruit-circuitpython-connectionmanager==3.1.5
|
adafruit-circuitpython-connectionmanager==3.1.6
|
||||||
adafruit-circuitpython-dht==4.0.9
|
adafruit-circuitpython-dht==4.0.10
|
||||||
adafruit-circuitpython-framebuf==1.6.9
|
adafruit-circuitpython-framebuf==1.6.10
|
||||||
adafruit-circuitpython-requests==4.1.13
|
adafruit-circuitpython-neopixel==6.3.18
|
||||||
adafruit-circuitpython-ssd1306==2.12.21
|
adafruit-circuitpython-pixelbuf==2.0.10
|
||||||
adafruit-circuitpython-typing==1.12.1
|
adafruit-circuitpython-requests==4.1.15
|
||||||
Adafruit-PlatformDetect==3.81.0
|
adafruit-circuitpython-ssd1306==2.12.22
|
||||||
|
adafruit-circuitpython-typing==1.12.3
|
||||||
|
Adafruit-PlatformDetect==3.84.1
|
||||||
Adafruit-PureIO==1.1.11
|
Adafruit-PureIO==1.1.11
|
||||||
binho-host-adapter==0.1.6
|
binho-host-adapter==0.1.6
|
||||||
cbor2==5.6.5
|
cbor2==5.7.1
|
||||||
luma.core==2.5.1
|
certifi==2025.11.12
|
||||||
|
charset-normalizer==3.4.4
|
||||||
|
colorclass==2.2.2
|
||||||
|
docopt==0.6.2
|
||||||
|
idna==3.11
|
||||||
|
luma.core==2.5.2
|
||||||
luma.oled==3.14.0
|
luma.oled==3.14.0
|
||||||
pillow==11.3.0
|
packaging==25.0
|
||||||
pyftdi==0.56.0
|
pillow==12.0.0
|
||||||
|
pip-upgrader==1.4.15
|
||||||
|
pyftdi==0.57.1
|
||||||
pyserial==3.5
|
pyserial==3.5
|
||||||
pyusb==1.3.1
|
pyusb==1.3.1
|
||||||
|
requests==2.32.5
|
||||||
RPi.GPIO==0.7.1
|
RPi.GPIO==0.7.1
|
||||||
rpi_ws281x==5.0.0
|
rpi_ws281x==5.0.0
|
||||||
|
setuptools==80.9.0
|
||||||
smbus==1.1.post2
|
smbus==1.1.post2
|
||||||
smbus2==0.5.0
|
smbus2==0.5.0
|
||||||
sysv_ipc==1.1.0
|
sysv_ipc==1.1.0
|
||||||
typing_extensions==4.14.1
|
terminaltables==3.1.10
|
||||||
|
typing_extensions==4.15.0
|
||||||
|
urllib3==2.5.0
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
import time
|
||||||
|
import board
|
||||||
|
import neopixel
|
||||||
|
|
||||||
|
# LED 설정
|
||||||
|
LED_COUNT = 6 # LED 개수
|
||||||
|
LED_PIN = board.D18 # GPIO 18번 (PWM 지원 핀)
|
||||||
|
ORDER = neopixel.GRB # WS2812B는 GRB 순서
|
||||||
|
|
||||||
|
# NeoPixel 객체 생성
|
||||||
|
pixels = neopixel.NeoPixel(
|
||||||
|
LED_PIN, LED_COUNT, brightness=1.0, auto_write=False, pixel_order=ORDER
|
||||||
|
)
|
||||||
|
|
||||||
|
# 색상 설정 함수
|
||||||
|
def color_wipe(color, wait=0.1):
|
||||||
|
for i in range(LED_COUNT):
|
||||||
|
pixels[i] = color
|
||||||
|
pixels.show()
|
||||||
|
time.sleep(wait)
|
||||||
|
|
||||||
|
# 무지개 색상 함수
|
||||||
|
def wheel(pos):
|
||||||
|
if pos < 85:
|
||||||
|
return (pos * 3, 255 - pos * 3, 0)
|
||||||
|
elif pos < 170:
|
||||||
|
pos -= 85
|
||||||
|
return (255 - pos * 3, 0, pos * 3)
|
||||||
|
else:
|
||||||
|
pos -= 170
|
||||||
|
return (0, pos * 3, 255 - pos * 3)
|
||||||
|
|
||||||
|
def rainbow_cycle(wait=0.01):
|
||||||
|
for j in range(255):
|
||||||
|
for i in range(LED_COUNT):
|
||||||
|
pixel_index = (i * 256 // LED_COUNT) + j
|
||||||
|
pixels[i] = wheel(pixel_index & 255)
|
||||||
|
pixels.show()
|
||||||
|
time.sleep(wait)
|
||||||
|
|
||||||
|
# 메인 루프
|
||||||
|
try:
|
||||||
|
while True:
|
||||||
|
color_wipe((255, 0, 0)) # 빨강
|
||||||
|
time.sleep(1)
|
||||||
|
color_wipe((0, 255, 0)) # 초록
|
||||||
|
time.sleep(1)
|
||||||
|
color_wipe((0, 0, 255)) # 파랑
|
||||||
|
time.sleep(1)
|
||||||
|
rainbow_cycle()
|
||||||
|
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
pixels.fill((0, 0, 0))
|
||||||
|
pixels.show()
|
||||||
Loading…
Reference in New Issue