1
1

More than 3 years have passed since last update.

toio.py でくるっと文字動画 #toio #おうちでロボット開発

Posted at

やったこと


toioの非公式ライブラリ toio.py に指定角度への回転コマンドを追加しました。

非公式 Python ライブラリ(https://github.com/mizumasa/toio.py.git)

できること

  • スピードの指定(speed オプション)
  • 回転方向の指定(clock オプション)
  • 加減速の指定(ease オプション)

などの機能を盛り込んでいます

サンプルコード

import toio                                                                               17 import random

def main():
    T = toio.TOIO()
    T.connect()
    for i in range(4):
        T.turn_to(i,int(360*random.random()))
    for i in range(4):
        T.turn_to(i,int(360*random.random()))
    for i in range(4):
        T.turn_to(i,90)
    T.disconnect()
    return

if __name__ == '__main__':
    main()

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