1
2

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.

M5StickC+UIFlowで振動モーターを動かしてみる

Last updated at Posted at 2021-03-19

#概要
UIFlowを使ってM5StickCで振動モーターを動かしてみました。

#接続方法
振動モータを下記に接続

  • GND
  • 26ピン

#コード

qiita.py
from m5stack import *
from m5ui import *
from uiflow import *
from easyIO import *
import time

setScreenColor(0x111111)

def buttonA_wasPressed():
  # global params
  digitalWrite(26, 1)
  wait(5)
  digitalWrite(26, 0)
  pass
btnA.wasPressed(buttonA_wasPressed)

digitalWrite(26, 0)

#試してみて思ったこと
配線がごちゃごちゃしてしまうので、最終的にはHatを活用してすっきりさせたいです。
M5StickC用 Vibrator Hat

#参考にしたサイト
M5StickCでLEDを点滅させてみる!汎用ポートGPIOやPWM制御って何?

1
2
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
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?