Last active
June 4, 2025 14:07
-
-
Save ymt117/3da6cadcd5c4c1253f7f53835794afbb to your computer and use it in GitHub Desktop.
Yawの値を変化させる
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "sbus.h" | |
#include <HardwareSerial.h> | |
HardwareSerial hs(0); | |
bfs::SbusRx sbus_rx(&hs, 20, 21, false); | |
bfs::SbusTx sbus_tx(&hs, 20, 21, false); | |
bfs::SbusData data; | |
void setup() { | |
sbus_rx.Begin(); | |
sbus_tx.Begin(); | |
} | |
void loop() { | |
// 任意のRC値(1000〜2000)を送信 | |
data.ch[0] = 1500; // Roll | |
data.ch[1] = 1500; // Pitch | |
data.ch[2] = 1000; // Throttle | |
data.ch[3] = 1500; // Yaw | |
sbus_tx.data(data); | |
sbus_tx.Write(); | |
delay(1000); | |
data.ch[0] = 1500; | |
data.ch[1] = 1500; | |
data.ch[2] = 1000; | |
data.ch[3] = 1000; // Yawのチャンネルの値を変更する | |
sbus_tx.data(data); | |
sbus_tx.Write(); | |
delay(1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment