CoilGun
coilgun.cpp
- Committer:
- Reiko
- Date:
- 2013-09-09
- Revision:
- 0:2d5820be7f51
- Child:
- 1:aa39e3a9d06f
File content as of revision 0:2d5820be7f51:
#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; }