Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of CoilGun by
Diff: coilgun.h
- Revision:
- 4:0e2bdd3d52bc
- Parent:
- 3:7273ba733560
- Child:
- 6:4c75db8a43db
--- a/coilgun.h Sat Sep 14 22:31:22 2013 +0000
+++ b/coilgun.h Sat Sep 14 22:57:17 2013 +0000
@@ -2,19 +2,37 @@
#define COILGUN_H
#include "mbed.h"
-
+
+/** Interface to the CoilGun*/
class CoilGun {
public:
- CoilGun(PinName chargePin, PinName kickPinName, PinName donePinName);
+ /** Create an instance of the CoilGun connected to specfied pins.
+ *
+ * @param chargePinName The charge pin.
+ * @param kickPinName The kick pin.
+ * @param donePinName The done pin.
+ */
+ CoilGun(PinName chargePinName, PinName kickPinName, PinName donePinName);
+ /** Kick with coilgun.
+ *
+ * @param length The length of the kick in uS
+ */
void kick(unsigned int length);
- void discharge(void); //Method that starts discharging
+
+ /** Discharge coilgun */
+ void discharge(void);
+
+ /** turn charging on or off
+ *
+ * @param chargeState Set true to charge. False, to not charge.
+ */
void setCharge(bool chargeState);
private:
DigitalOut chargePin;
DigitalOut kickPin;
- InterruptIn done;
+ InterruptIn donePin;
void doneCallback(void);
bool kicking; //True while kick is in progress
