Jeno Szabo / Mbed 2 deprecated Clock_06_OK

Dependencies:   TSI mbed

Fork of RTC8564NB_Clock by masa miya

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "GLCD_spi.h"
00003 #include "TouchMenu.h"
00004 #include "RTC.h"
00005 
00006 
00007 
00008 
00009 //char buffer[12];
00010 int m_value,b;
00011 //-------------------------------------------------
00012 void Start(){
00013     SPI_init();
00014     lcd_init();
00015     
00016     K_LED=1;
00017     Z_LED=1;
00018     P_LED=1;
00019     lcd_cls();
00020     lcd_string(2,6,"RTC Start");
00021     Bip(2,3);       // 1 kHz * freki, 0.1 s * time
00022     //rtc_reset();
00023     rtc_data_set();
00024     lcd_cls();
00025     //a=0;
00026     b=0;
00027 }
00028 //-------------------------------------------------
00029     
00030 int main() {
00031     Start();
00032     //rtc_reset();
00033     while(1){
00034         rtc_data_read();
00035         if(sec != b){
00036             //Bip(1,1);
00037             b=sec;
00038             Z_LED =0;
00039             wait(.1);
00040             Z_LED=1;
00041         }
00042     }
00043     //for(;;){}
00044 
00045 }