Alarm Clock

Dependencies:   TextLCD mbed

Fork of SmartRise_MBED by Austin Sloop

main.cpp

Committer:
asloop18
Date:
2016-01-24
Revision:
2:261fce57a100
Parent:
1:989eb818d3a3
Child:
3:51b248042aa0

File content as of revision 2:261fce57a100:

//8.3 LCD control with MBED main.

#include "mbed.h"
#include "LCD.h"
#include "TextLCD.h"

TextLCD lcd(p27,p28,p23,p24,p25,p26);

int main() {
    int Ahr,Amin; 
    while(1) {
        time_t seconds = time(NULL);
        
        Ahr=11;Amin=30;
        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:%I:%I", buffer, Ahr, Amin);

        wait(1);
    }
}