Everything works except AMPM and snooze
Dependencies: 4DGL-uLCD-SE EthernetInterface HTTPClient NTPClient PinDetect SDFileSystem mbed-rpc mbed-rtos mbed wave_player
Fork of ECE4180_FinalProject by
Diff: alarmModel.cpp
- Revision:
- 0:0a99e3fc2a46
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/alarmModel.cpp Sat Nov 15 19:36:44 2014 +0000 @@ -0,0 +1,19 @@ +#include "mbed.h" +#include "alarmModel.h" + +alarmModel::alarmModel() {} + +void alarmModel::updateAlarmPreference(int _hours, int _minutes, int _amPm){ + hours = _hours; + minutes = _minutes; + if(_amPm == 0){ amPm = "AM"; } + else if (_amPm == 1){ amPm = "PM"; } + printf("Alarm preference updated to %d:%d %s \n", hours, minutes, amPm); +} + +void alarmModel::setAlarm(){ + if(alarmSet == 1) printf("Alarm already set.\n"); + else{ + alarmSet = 1; + } +} \ No newline at end of file