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?

More than 3 years have passed since last update.

STM32L010とWS2812BとPython 3.7.6(PC)で光らす。

Last updated at Posted at 2021-06-13

目的
PCからマイコンを通してWS2812Bをコントロールする。

前提、まず、STM32L010とWS2812Bのシリアコントールを構築
STM32L010とWS2812Bを使い、シリアルから入力された値で光らす。

serial_ws2812_010_1_2.jpg

dwtsssss6.jpg

selial_ws2812_303_1_2.jpg



import serial
import time
ser = serial.Serial('COM6',9600,timeout=None)
print ("tttt")
time.sleep(0.1)
ser.write(b'123')
time.sleep(2)
ser.write(b'a!!')
print ("rrr")
time.sleep(2)
ser.write(b'!a!')
time.sleep(2)
ser.write(b'!!a')
ser.close() 



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?