Dependents:   ShootingSystem

Revision:
1:2a43c09cc3be
Parent:
0:49a747f09bd2
--- a/AmmoSupplier.h	Fri Aug 21 04:52:23 2015 +0000
+++ b/AmmoSupplier.h	Wed Oct 14 03:52:41 2015 +0000
@@ -2,30 +2,30 @@
 #define INCLUDED_AMMO_SUPPLIER_H
 
 #include "mbed.h"
-class I2CMotor;
+#include "I2CDevice.h"
 
-class AmmoSupplier{
+class AmmoSupplier : public I2CDevice{
 public:
-    AmmoSupplier( I2CMotor** motor );
+    AmmoSupplier( char address );
     
-    void update();
-    
+    void supply(){
+        mSupplyCommand = true;
+    }
     bool isSupplying(){
         return mIsSupplying;
     }
-    void supply(){
-        mIsSupplying = true;
-        mTimer->start();
+    bool hasSupplied(){
+        return mHasSupplied;
+        //return true;
     }
+    
+    virtual int write();
+    virtual int read();
+    
 private:
-    static const float mTimeout_sec;
-    static const PinName mLazerSensorDinPinName;
-    static const float mDuty;
-    
-    I2CMotor** mSupplier;
-    DigitalIn* mAmmoLazerSensor;
-    Timer* mTimer;
+    bool mSupplyCommand;
     bool mIsSupplying;
+    bool mHasSupplied;
 };
 
 #endif