mirror of
https://gitlab.com/lander-team/tvc-test-code.git
synced 2025-06-16 15:06:56 +00:00
simple servo boilerplay
This commit is contained in:
parent
d6aa7602a1
commit
df0f021473
18
src/main.cpp
18
src/main.cpp
@ -1,9 +1,23 @@
|
||||
#include <Arduino.h>
|
||||
#include <Servo.h>
|
||||
|
||||
Servo yaw;
|
||||
Servo pitch;
|
||||
|
||||
void setup() {
|
||||
// put your setup code here, to run once:
|
||||
yaw.attach(9); // CHANGE MEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
|
||||
pitch.attach(10); // CHANGE MEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// put your main code here, to run repeatedly:
|
||||
for (int pos = 0; pos <= 180; pos += 1) {
|
||||
yaw.write(pos);
|
||||
pitch.write(pos);
|
||||
delay(15);
|
||||
}
|
||||
for (int pos = 180; pos >= 0; pos -= 1) {
|
||||
yaw.write(pos);
|
||||
pitch.write(pos);
|
||||
delay(15);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user