Alarm Clock

Dependencies:   TextLCD mbed

Fork of SmartRise_MBED by Austin Sloop

main.cpp

Committer:
asloop18
Date:
2016-01-26
Revision:
4:33f3750fe70a
Parent:
3:51b248042aa0
Child:
5:90f059fdc625
Child:
6:73866b51e0b7

File content as of revision 4:33f3750fe70a:

//8.3 LCD control with MBED main.

#include "mbed.h"
#include "TextLCD.h"
#include "TimeControl.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 safetyOff(p5);


int main() {
    time_init();
}
   
   
   
   
   
   
/*   
    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 ){

        
*/