Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Tank.h
00001 /* 00002 * G3: WATERPLAY 00003 */ 00004 00005 #ifndef TANK_H 00006 #define TANK_H 00007 00008 #include "DRV8825.h" 00009 #include "Flasher.h" 00010 #include "Ping.h" 00011 #include "Printer.h" 00012 #include "mbed.h" 00013 00014 class Tank 00015 { 00016 public: 00017 Tank( 00018 Printer &printer, 00019 DRV8825 &salinitySyringe, 00020 DRV8825 &waterSyringe, 00021 Ping &pinger, 00022 Flasher &alarm 00023 ); 00024 static const int DIRECTION_PULL = 1; 00025 static const int DIRECTION_PUSH = 0; 00026 static const int TYPE_SALT = 1; 00027 static const int TYPE_PURE = 0; 00028 static const int POSITION_MAX = 35; 00029 static const int POSITION_MIN = 0; 00030 static const int MAX_SPEED = 8000; 00031 static const int MICROSTEPS_PER_STEP = 32; 00032 static const int MOVEMENT = 4600; 00033 static const int STEP_EXTRA = 3000; 00034 static const float ADDED_SALT = 15.0; 00035 static const float ADDED_WATER = 15.0; 00036 static const int PROXIMITY_CHECK_POINT = 100; 00037 void add(int type, int mililiters, int direction); 00038 void react(double salinity); 00039 bool is_proximity_ok(); 00040 char* getStrStatus(); 00041 void initialize(); 00042 00043 private: 00044 Printer &_printer; 00045 DRV8825 &_salinitySyringe; 00046 DRV8825 &_waterSyringe; 00047 Ping &_pinger; 00048 Flasher &_alarm; 00049 int _status; 00050 char* _strStatus; 00051 int _previous_direction_salt; 00052 int _previous_direction_pure; 00053 int _position_salt; 00054 int _position_pure; 00055 float _added_liquid; 00056 }; 00057 00058 #endif
Generated on Tue Jul 12 2022 19:11:49 by
1.7.2