Add Servo debug script

This commit is contained in:
Matthew McWilliams 2022-07-06 14:42:16 -04:00
parent c3661d6ff1
commit c0ec81c0f9
1 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,36 @@
#include <Servo.h>
const int PIN_SERVO = 9;
Servo servo;
/*
----------------------------------------------------
Servo - Arduino
-
Red - 5V
Black - GND
Yellow - PWM Pin (9 in this example)
Using TowerPro SG-5010 - default 93
TowerPro MG-995 -
as servos for development
----------------------------------------------------
*/
void setup() {
Serial.begin(57600);
Serial.flush();
Servo_init();
}
void loop() {
}
void Servo_init () {
servo.attach(PIN_SERVO);
int angle = servo.read();
Serial.print("Default angle: ");
Serial.println(angle);
}