Robsonema - Nucleo Master FM

Dependencies:   mbed ros_lib_melodic

Revision:
0:a4a02499a5f3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Kicker/Kicker.cpp	Mon Oct 26 22:25:16 2020 +0000
@@ -0,0 +1,31 @@
+#ifndef KICKER_CPP
+#define KICKER_CPP
+#include "Kicker.h"
+#include <mbed.h>
+#include "config.h"
+
+DigitalOut * selenoid;
+DigitalOut * charge;
+
+Kicker::Kicker()
+{
+    selenoid = new DigitalOut(PORT_SELENOID);
+    charge = new DigitalOut(PORT_CHARGE);
+    selenoid->write(0);
+    charge->write(1);
+}
+
+void Kicker::kicker(float kick_speed)
+{
+    if(kick_speed != 0) {
+        charge->write(0);
+        wait_ms(200);
+        selenoid->write(1);
+        wait_ms(kick_speed);
+        selenoid->write(0);
+        wait_ms(100);
+        charge->write(1);
+    }
+}
+
+#endif
\ No newline at end of file