LoginSignup
3
3

More than 3 years have passed since last update.

micro:bitで傾きを調べる

Posted at

傾きセンサー

micro:bitには傾きセンサーが内蔵されているので、何度傾いているかを取得することが出来る。
傾きを調べて、5x5のLEDの、水平のときは真ん中を点灯、1度傾いたときはその方向に中心から1個離れたところを点灯、2度傾いたときは中心から2個目(5x5だから一番外側)を点灯するプログラムを書いてみた。
2020-02-01-000642_1043x569_scrot.png

動かすとこんな感じに。
うまく動いてるようだ。
leveler.gif

3
3
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
3
3