DoubleCoilGun

Dependents:   Telliskivi2_2014

Fork of CoilGun by Reiko Randoja

Revision:
0:2d5820be7f51
Child:
1:aa39e3a9d06f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/coilgun.cpp	Mon Sep 09 17:07:52 2013 +0000
@@ -0,0 +1,26 @@
+#include "motor.h"
+
+CoilGun::CoilGun(PinName chargePin, PinName kickPin, PinName donePin)
+    : charge(chargePin), kick(kickPin), done(donePin) {
+    done.fall(this, &CoilGun.doneCallback);
+}
+
+void CoilGun::kick(int length) {
+    
+}
+
+void CoilGun::setCharge(bool chargeState) {
+    if (setCharge) {
+        charge = 1;
+    } else {
+        charge = 0;
+    }    
+}
+
+void CoilGun::discharge() {
+    charge = 0;
+}
+
+void CoilGun::doneCallback(void) {
+    charge = 0;
+}
\ No newline at end of file