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
coilgun.h@2:781ea1999ad3, 2013-09-14 (annotated)
- Committer:
- Reiko
- Date:
- Sat Sep 14 17:30:54 2013 +0000
- Revision:
- 2:781ea1999ad3
- Parent:
- 1:aa39e3a9d06f
- Child:
- 3:7273ba733560
Improved kick functionality
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Reiko | 0:2d5820be7f51 | 1 | #ifndef COILGUN_H |
| Reiko | 0:2d5820be7f51 | 2 | #define COILGUN_H |
| Reiko | 0:2d5820be7f51 | 3 | |
| Reiko | 0:2d5820be7f51 | 4 | #include "mbed.h" |
| Reiko | 0:2d5820be7f51 | 5 | |
| Reiko | 0:2d5820be7f51 | 6 | class CoilGun { |
| Reiko | 0:2d5820be7f51 | 7 | public: |
| Reiko | 1:aa39e3a9d06f | 8 | CoilGun(PinName chargePin, PinName kickPinName, PinName donePinName); |
| Reiko | 0:2d5820be7f51 | 9 | |
| Reiko | 2:781ea1999ad3 | 10 | void kick(unsigned int length); |
| Reiko | 1:aa39e3a9d06f | 11 | void discharge(); |
| Reiko | 0:2d5820be7f51 | 12 | void setCharge(bool chargeState); |
| Reiko | 0:2d5820be7f51 | 13 | |
| Reiko | 0:2d5820be7f51 | 14 | private: |
| Reiko | 1:aa39e3a9d06f | 15 | DigitalOut chargePin; |
| Reiko | 1:aa39e3a9d06f | 16 | DigitalOut kickPin; |
| Reiko | 1:aa39e3a9d06f | 17 | InterruptIn done; |
| Reiko | 1:aa39e3a9d06f | 18 | void doneCallback(void); |
| Reiko | 2:781ea1999ad3 | 19 | void kickEnd(void); |
| Reiko | 0:2d5820be7f51 | 20 | }; |
| Reiko | 0:2d5820be7f51 | 21 | |
| Reiko | 0:2d5820be7f51 | 22 | #endif |
