![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Alarm Clock
Fork of SmartRise_MBED by
main.cpp
- Committer:
- pstephens18
- Date:
- 2016-01-26
- Revision:
- 5:90f059fdc625
- Parent:
- 4:33f3750fe70a
- Child:
- 7:5412a6d7ef6d
File content as of revision 5:90f059fdc625:
//8.3 LCD control with MBED main. #include "mbed.h" #include "TextLCD.h" #include "TimeControl.h" #include "Alarm.h" #include <time.h> Serial pc(USBTX,USBRX); TextLCD lcd(p27,p28,p23,p24,p25,p26); //RS E d1,d2,d3,d4 DigitalIn HrAdjustUp(p6); DigitalIn HrAdjustDown(p7); DigitalIn MinAdjust(p8); //buttons for setting time and alarm DigitalIn AlarmAdjust(p9); InterruptIn off(p15); InterruptIn safetyOff(p5); int main() { time_init(); off.rise(&turn_off); } /* while(1) { time_t seconds = time(NULL); char buffer[32]; strftime(buffer, 32, "%a%m/%d %I:%M%p", localtime(&seconds)); //day, #month/#day Hr:min (AP)M wait(0.1); lcd.printf("%s Alarm-%2I:%.2I", buffer, Ahr, Amin); time_t a=localtime(&seconds); pc.printf("%i",a); //current problem void Alarm(void); if(AlarmAdjust==1&&set.read()>0.3){ //to be in main to call alarm adjust if(HrAdjustUp==1) {Ahr=Ahr+1;set.reset();} if(HrAdjustDown==1) {Ahr=Ahr-1;set.reset();} if(MinAdjust==1) {Amin=Amin+1;set.reset();} if(Ahr>23) Ahr=0; if(Amin>=60) Amin=0; } // if( Ahr=___&&Amin=((localtime(&secods)%3600)/60 ){ */