Dependents:   ShootingSystem

Revision:
0:49a747f09bd2
Child:
1:2a43c09cc3be
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/AmmoSupplier.h	Fri Aug 21 04:52:23 2015 +0000
@@ -0,0 +1,31 @@
+#ifndef INCLUDED_AMMO_SUPPLIER_H
+#define INCLUDED_AMMO_SUPPLIER_H
+
+#include "mbed.h"
+class I2CMotor;
+
+class AmmoSupplier{
+public:
+    AmmoSupplier( I2CMotor** motor );
+    
+    void update();
+    
+    bool isSupplying(){
+        return mIsSupplying;
+    }
+    void supply(){
+        mIsSupplying = true;
+        mTimer->start();
+    }
+private:
+    static const float mTimeout_sec;
+    static const PinName mLazerSensorDinPinName;
+    static const float mDuty;
+    
+    I2CMotor** mSupplier;
+    DigitalIn* mAmmoLazerSensor;
+    Timer* mTimer;
+    bool mIsSupplying;
+};
+
+#endif