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:
- 8:eee78d8bfdb9
- Parent:
- 6:4c75db8a43db
- Child:
- 10:7518047a0375
--- a/coilgun.h Thu Sep 19 13:11:48 2013 +0000
+++ b/coilgun.h Thu Sep 19 14:29:24 2013 +0000
@@ -6,16 +6,30 @@
/** Class for controlling coilgun */
class Coilgun {
public:
+ /** Create an instance of the Coilgun connected to specfied pins */
Coilgun(PinName kickPinName ,PinName chargePinName, PinName donePinName);
+
+ /** Kick with coilgun */
void kick(unsigned int length);
+ /** Stop kick */
void kickEnd(void);
+ /** Charge capacitor */
void charge(void);
+ /** Stop charging capacitor */
void chargeEnd(void);
+ /** Discharge capacitor */
void discharge(void);
+ /** Stop discharging */
void dischargeEnd(void);
+ /** Read only
+ * Will be set to true, when charge() is called,
+ * false, when discharge is called.
+ * NB! if discharge is interrupted, capacitor may still have some charge on it.
+ */
+ bool isCharged;
private:
enum State {idle, kicking, charging, discharging};
