From 58b4bc754bbb9f5197119cd0c124e49c05acff46 Mon Sep 17 00:00:00 2001 From: Dawsyn Schraiber <32221234+dawsynth@users.noreply.github.com> Date: Thu, 13 Jun 2024 14:30:58 -0400 Subject: Where to begin…. (#13) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit +/- Reworked collection of altimeter related functions into altimeter class +/- Reworked bno055 class to be imu class with minimal functionality \- Removed external Kalman filter implementations in favor of own in house version \- Removed any/unused files \+ Added buffer logger for when sitting on pad for extended period of time in effort to prevent filling of flash chip \+ Added heartbeat LED for alive status --- tools/servo_test.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tools/servo_test.cpp (limited to 'tools/servo_test.cpp') diff --git a/tools/servo_test.cpp b/tools/servo_test.cpp new file mode 100644 index 0000000..c5e8e6e --- /dev/null +++ b/tools/servo_test.cpp @@ -0,0 +1,27 @@ +#include +#include +#include "pico/stdio.h" +#include "pwm.hpp" + +#define MOSFET_PIN 1 + +PWM pwm; + +int main() { + stdio_init_all(); + // Initialize MOSFET + gpio_init(MOSFET_PIN); + gpio_set_dir(MOSFET_PIN, GPIO_OUT); + gpio_put(MOSFET_PIN, 1); + pwm.init(); + uint8_t duty_cycle = 13; + while (1) { + getchar(); + if (duty_cycle == 2) { + duty_cycle = 13; + } + pwm.set_duty_cycle(duty_cycle); + printf("Currenty Duty Cycle: %" PRIu8 "\n", duty_cycle); + duty_cycle--; + } +} -- cgit v1.2.3