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.
Dependencies: mbed DRV88255 TextLCD Ping mbed-rtos
AlarmController.h
- Committer:
- joran
- Date:
- 2016-06-14
- Revision:
- 27:4f73f754fdc9
- Parent:
- 20:521f795ea9d7
- Child:
- 38:930469a33001
File content as of revision 27:4f73f754fdc9:
#ifndef __ALARMCONTROLLER_H__
#define __ALARMCONTROLLER_H__
#include "mbed.h"
#include "SensorController.h"
class AlarmController : public Controller {
public:
AlarmController(bool threaded, int interval_ms, SensorController *temp, SensorController *salt, SensorController *proximity)
: Controller(threaded, interval_ms) {
this->temp = temp;
this->salt = salt;
this->proximity = proximity;
this->error = false;
this->tempiscrit = false;
this->saltiscrit = false;
this->overflowiscrit = false;
}
virtual void update();
virtual std::string get_name();
bool is_error();
char *get_error_message();
void buzzOnce();
void raiseAlarmTemp(bool);
void raiseAlarmSalt(bool);
void raiseAlarmOverFlow(bool);
private:
SensorController *temp;
SensorController *salt;
SensorController *proximity;
bool error;
char *error_msg;
void activate_buzzer();
bool tempiscrit;
bool saltiscrit;
bool overflowiscrit;
};
#endif