AmmoSupplier.h@0:49a747f09bd2, 2015-08-21 (annotated)
- Committer:
- inst
- Date:
- Fri Aug 21 04:52:23 2015 +0000
- Revision:
- 0:49a747f09bd2
- Child:
- 1:2a43c09cc3be
y evol
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
inst | 0:49a747f09bd2 | 1 | #ifndef INCLUDED_AMMO_SUPPLIER_H |
inst | 0:49a747f09bd2 | 2 | #define INCLUDED_AMMO_SUPPLIER_H |
inst | 0:49a747f09bd2 | 3 | |
inst | 0:49a747f09bd2 | 4 | #include "mbed.h" |
inst | 0:49a747f09bd2 | 5 | class I2CMotor; |
inst | 0:49a747f09bd2 | 6 | |
inst | 0:49a747f09bd2 | 7 | class AmmoSupplier{ |
inst | 0:49a747f09bd2 | 8 | public: |
inst | 0:49a747f09bd2 | 9 | AmmoSupplier( I2CMotor** motor ); |
inst | 0:49a747f09bd2 | 10 | |
inst | 0:49a747f09bd2 | 11 | void update(); |
inst | 0:49a747f09bd2 | 12 | |
inst | 0:49a747f09bd2 | 13 | bool isSupplying(){ |
inst | 0:49a747f09bd2 | 14 | return mIsSupplying; |
inst | 0:49a747f09bd2 | 15 | } |
inst | 0:49a747f09bd2 | 16 | void supply(){ |
inst | 0:49a747f09bd2 | 17 | mIsSupplying = true; |
inst | 0:49a747f09bd2 | 18 | mTimer->start(); |
inst | 0:49a747f09bd2 | 19 | } |
inst | 0:49a747f09bd2 | 20 | private: |
inst | 0:49a747f09bd2 | 21 | static const float mTimeout_sec; |
inst | 0:49a747f09bd2 | 22 | static const PinName mLazerSensorDinPinName; |
inst | 0:49a747f09bd2 | 23 | static const float mDuty; |
inst | 0:49a747f09bd2 | 24 | |
inst | 0:49a747f09bd2 | 25 | I2CMotor** mSupplier; |
inst | 0:49a747f09bd2 | 26 | DigitalIn* mAmmoLazerSensor; |
inst | 0:49a747f09bd2 | 27 | Timer* mTimer; |
inst | 0:49a747f09bd2 | 28 | bool mIsSupplying; |
inst | 0:49a747f09bd2 | 29 | }; |
inst | 0:49a747f09bd2 | 30 | |
inst | 0:49a747f09bd2 | 31 | #endif |