From c0ec81c0f9880c56cf3c888105ac2a450020989e Mon Sep 17 00:00:00 2001 From: Matthew McWilliams Date: Wed, 6 Jul 2022 14:42:16 -0400 Subject: [PATCH] Add Servo debug script --- .../mcopy_servo_debug/mcopy_servo_debug.ino | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 ino/components/mcopy_servo_debug/mcopy_servo_debug.ino diff --git a/ino/components/mcopy_servo_debug/mcopy_servo_debug.ino b/ino/components/mcopy_servo_debug/mcopy_servo_debug.ino new file mode 100644 index 0000000..4788f54 --- /dev/null +++ b/ino/components/mcopy_servo_debug/mcopy_servo_debug.ino @@ -0,0 +1,36 @@ +#include + +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); +}