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 Paul Rabbat

Committer:
adaruna3
Date:
Wed Dec 03 17:59:07 2014 +0000
Revision:
9:add6ce18f1b7
Parent:
0:0a99e3fc2a46
All features working

Who changed what in which revision?

UserRevisionLine numberNew contents of line
prabbat3 0:0a99e3fc2a46 1 #include "mbed.h"
prabbat3 0:0a99e3fc2a46 2 #include "alarmModel.h"
prabbat3 0:0a99e3fc2a46 3
prabbat3 0:0a99e3fc2a46 4 alarmModel::alarmModel() {}
prabbat3 0:0a99e3fc2a46 5
prabbat3 0:0a99e3fc2a46 6 void alarmModel::updateAlarmPreference(int _hours, int _minutes, int _amPm){
prabbat3 0:0a99e3fc2a46 7 hours = _hours;
prabbat3 0:0a99e3fc2a46 8 minutes = _minutes;
prabbat3 0:0a99e3fc2a46 9 if(_amPm == 0){ amPm = "AM"; }
prabbat3 0:0a99e3fc2a46 10 else if (_amPm == 1){ amPm = "PM"; }
prabbat3 0:0a99e3fc2a46 11 printf("Alarm preference updated to %d:%d %s \n", hours, minutes, amPm);
prabbat3 0:0a99e3fc2a46 12 }
prabbat3 0:0a99e3fc2a46 13
prabbat3 0:0a99e3fc2a46 14 void alarmModel::setAlarm(){
prabbat3 0:0a99e3fc2a46 15 if(alarmSet == 1) printf("Alarm already set.\n");
prabbat3 0:0a99e3fc2a46 16 else{
prabbat3 0:0a99e3fc2a46 17 alarmSet = 1;
prabbat3 0:0a99e3fc2a46 18 }
prabbat3 0:0a99e3fc2a46 19 }