Saltware / Mbed 2 deprecated Water Play

Dependencies:   mbed DRV88255 TextLCD Ping mbed-rtos

Committer:
sbouber1
Date:
Tue Jun 14 17:49:08 2016 +0000
Revision:
38:930469a33001
Parent:
27:4f73f754fdc9
Child:
40:1668630544c7
update

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sbouber1 10:fd4670ec0806 1 #ifndef __ALARMCONTROLLER_H__
sbouber1 10:fd4670ec0806 2 #define __ALARMCONTROLLER_H__
sbouber1 10:fd4670ec0806 3
sbouber1 10:fd4670ec0806 4 #include "mbed.h"
sbouber1 10:fd4670ec0806 5 #include "SensorController.h"
sbouber1 10:fd4670ec0806 6
sbouber1 38:930469a33001 7 #define STARTUP_ITERATIONS 10
sbouber1 38:930469a33001 8
sbouber1 10:fd4670ec0806 9
sbouber1 10:fd4670ec0806 10 class AlarmController : public Controller {
sbouber1 10:fd4670ec0806 11
sbouber1 10:fd4670ec0806 12
sbouber1 10:fd4670ec0806 13 public:
sbouber1 10:fd4670ec0806 14 AlarmController(bool threaded, int interval_ms, SensorController *temp, SensorController *salt, SensorController *proximity)
sbouber1 10:fd4670ec0806 15 : Controller(threaded, interval_ms) {
sbouber1 10:fd4670ec0806 16 this->temp = temp;
sbouber1 10:fd4670ec0806 17 this->salt = salt;
joran 20:521f795ea9d7 18 this->proximity = proximity;
joran 20:521f795ea9d7 19 this->error = false;
joran 20:521f795ea9d7 20 this->tempiscrit = false;
joran 20:521f795ea9d7 21 this->saltiscrit = false;
joran 27:4f73f754fdc9 22 this->overflowiscrit = false;
sbouber1 10:fd4670ec0806 23 }
sbouber1 10:fd4670ec0806 24
sbouber1 10:fd4670ec0806 25 virtual void update();
sbouber1 10:fd4670ec0806 26
sbouber1 10:fd4670ec0806 27 virtual std::string get_name();
sbouber1 10:fd4670ec0806 28
sbouber1 10:fd4670ec0806 29 bool is_error();
sbouber1 10:fd4670ec0806 30
sbouber1 11:1a0a8fd74bc0 31 char *get_error_message();
joran 20:521f795ea9d7 32
joran 20:521f795ea9d7 33 void buzzOnce();
joran 20:521f795ea9d7 34 void raiseAlarmTemp(bool);
joran 20:521f795ea9d7 35 void raiseAlarmSalt(bool);
joran 27:4f73f754fdc9 36 void raiseAlarmOverFlow(bool);
sbouber1 10:fd4670ec0806 37
sbouber1 10:fd4670ec0806 38
sbouber1 10:fd4670ec0806 39 private:
sbouber1 10:fd4670ec0806 40 SensorController *temp;
sbouber1 10:fd4670ec0806 41 SensorController *salt;
sbouber1 10:fd4670ec0806 42 SensorController *proximity;
sbouber1 10:fd4670ec0806 43
sbouber1 10:fd4670ec0806 44 bool error;
sbouber1 11:1a0a8fd74bc0 45 char *error_msg;
sbouber1 10:fd4670ec0806 46
sbouber1 11:1a0a8fd74bc0 47 void activate_buzzer();
joran 20:521f795ea9d7 48 bool tempiscrit;
joran 20:521f795ea9d7 49 bool saltiscrit;
joran 27:4f73f754fdc9 50 bool overflowiscrit;
joran 27:4f73f754fdc9 51
joran 27:4f73f754fdc9 52
sbouber1 10:fd4670ec0806 53 };
sbouber1 10:fd4670ec0806 54
sbouber1 10:fd4670ec0806 55
sbouber1 10:fd4670ec0806 56 #endif