2
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 1 year has passed since last update.

PlatformIOのSTM32 (Arduino Framework) でパルスサーボを制御する

Last updated at Posted at 2024-02-29

めっちゃ簡単なことなのに0.5秒くらいハマったので書く

標準ライブラリは使用できない

いつもだったらPlatformIO→LibrariesからServoライブラリをAddして使用すると思うが、こちらはSTM32に標準で対応していない。

Platformsを参照。Atmel AVRとAtmel SAMしか対応していない。

スクリーンショット 2024-02-29 17.57.13.png

解決策

GitHubからstm32duino標準ライブラリを引っ張ってくる

拙い図だが、こんな感じでプロジェクトフォルダの中に配置してあとは普通にincludeして使うだけ。

スクリーンショット 2024-02-29 18.00.06.png

#include "./servo/Servo.h"
Servo servo;

参考文献

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