Saltware / Mbed 2 deprecated Water Play

Dependencies:   mbed DRV88255 TextLCD Ping mbed-rtos

Committer:
joran
Date:
Mon Jun 13 12:51:19 2016 +0000
Revision:
20:521f795ea9d7
Parent:
19:ee89eabe1fa2
Child:
27:4f73f754fdc9
This includes alarm!

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 10:fd4670ec0806 7
sbouber1 10:fd4670ec0806 8 class AlarmController : public Controller {
sbouber1 10:fd4670ec0806 9
sbouber1 10:fd4670ec0806 10
sbouber1 10:fd4670ec0806 11 public:
sbouber1 10:fd4670ec0806 12 AlarmController(bool threaded, int interval_ms, SensorController *temp, SensorController *salt, SensorController *proximity)
sbouber1 10:fd4670ec0806 13 : Controller(threaded, interval_ms) {
sbouber1 10:fd4670ec0806 14 this->temp = temp;
sbouber1 10:fd4670ec0806 15 this->salt = salt;
joran 20:521f795ea9d7 16 this->proximity = proximity;
joran 20:521f795ea9d7 17 this->error = false;
joran 20:521f795ea9d7 18 this->tempiscrit = false;
joran 20:521f795ea9d7 19 this->saltiscrit = false;
sbouber1 10:fd4670ec0806 20 }
sbouber1 10:fd4670ec0806 21
sbouber1 10:fd4670ec0806 22 virtual void update();
sbouber1 10:fd4670ec0806 23
sbouber1 10:fd4670ec0806 24 virtual std::string get_name();
sbouber1 10:fd4670ec0806 25
sbouber1 10:fd4670ec0806 26 bool is_error();
sbouber1 10:fd4670ec0806 27
sbouber1 11:1a0a8fd74bc0 28 char *get_error_message();
joran 20:521f795ea9d7 29
joran 20:521f795ea9d7 30 void buzzOnce();
joran 20:521f795ea9d7 31 void raiseAlarmTemp(bool);
joran 20:521f795ea9d7 32 void raiseAlarmSalt(bool);
sbouber1 10:fd4670ec0806 33
sbouber1 10:fd4670ec0806 34
sbouber1 10:fd4670ec0806 35 private:
sbouber1 10:fd4670ec0806 36 SensorController *temp;
sbouber1 10:fd4670ec0806 37 SensorController *salt;
sbouber1 10:fd4670ec0806 38 SensorController *proximity;
sbouber1 10:fd4670ec0806 39
sbouber1 10:fd4670ec0806 40 bool error;
sbouber1 11:1a0a8fd74bc0 41 char *error_msg;
sbouber1 10:fd4670ec0806 42
sbouber1 11:1a0a8fd74bc0 43 void activate_buzzer();
joran 20:521f795ea9d7 44 bool tempiscrit;
joran 20:521f795ea9d7 45 bool saltiscrit;
sbouber1 10:fd4670ec0806 46 };
sbouber1 10:fd4670ec0806 47
sbouber1 10:fd4670ec0806 48
sbouber1 10:fd4670ec0806 49 #endif