ok

Dependencies:   mbed

Fork of g3_waterplay by Mario Simaremare

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Tank.h Source File

Tank.h

00001 /*
00002 * G3: WATERPLAY
00003 */
00004 
00005 #ifndef TANK_H
00006 #define TANK_H
00007 
00008 #include "DRV8825.h"
00009 #include "Ping.h"
00010 #include "Printer.h"
00011 #include "mbed.h"
00012 
00013 class Tank
00014 {
00015 public:
00016     Tank(
00017         Printer &printer,
00018         DRV8825 &salinitySyringe,
00019         DRV8825 &waterSyringe,
00020         Ping &pinger
00021     );
00022     static const int DIRECTION_PULL = 1;
00023     static const int DIRECTION_PUSH = 0;
00024     static const int TYPE_SALT = 1;
00025     static const int TYPE_PURE = 0;
00026     static const int POSITION_MAX = 35;
00027     static const int POSITION_MIN = 0;
00028     static const int MAX_SPEED = 8000;
00029     static const int MICROSTEPS_PER_STEP = 32;
00030     static const int MOVEMENT = 4600;
00031     static const int STEP_EXTRA = 3000;
00032     void add(int type, int mililiters, int direction);
00033     void react(double salinity);
00034     bool is_proximity_ok();
00035 
00036 private:
00037     Printer &_printer;
00038     DRV8825 &_salinitySyringe;
00039     DRV8825 &_waterSyringe;
00040     Ping &_pinger;
00041     int _status;
00042     int _strStatus;
00043     int _previous_direction_salt;
00044     int _previous_direction_pure;
00045     int _position_salt;
00046     int _position_pure;
00047 };
00048 
00049 #endif