ELEC

Dependencies:   BME280 BMP280 TextLCD mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "TextLCD.h"
00003 #include "BMP280.h"
00004 #include "putty.h"
00005 #include"date.h"
00006 //DigitalOut myled(LED1);
00007 
00008 
00009 Ticker display;
00010 
00011 
00012 void lcddisp()
00013 { 
00014     getdata();
00015     store();
00016     lcd.cls();
00017     display_time();
00018     lcd.locate(10,0);
00019     lcd.printf("l:%1.2f", lvl);
00020     lcd.locate(0,0);
00021     lcd.printf("p:%3.1f", pressuref);
00022     lcd.locate(10,1);
00023     lcd.printf("t:%3.1f", tempf);
00024 }
00025 
00026 
00027 
00028 int main()
00029 {
00030     lcd.cls();
00031     display_date();
00032     while (pointer != 14)
00033     {
00034         select_date();
00035     }
00036     bmp.initialize();
00037     pc.printf("putty ready\n\r");
00038     display.attach(&lcddisp, 2.0);
00039     while(1)
00040     {
00041             int count = 0;
00042             int wcount = 0;
00043             //char c[20] = {0};
00044             //char c2[20] = {0};
00045             while (user_command[wcount]!= ' ')
00046             {
00047             user_command[count] = pc.getc();
00048             pc.putc(user_command[count]);
00049             count++;
00050             wcount = count -1;
00051             }
00052             int count2 = 0;
00053             int wcount2 = 0;
00054             while(user_command2[wcount2]!= '\r')
00055             {
00056             user_command2[count2] = pc.getc();
00057             pc.putc(user_command2[count2]);
00058             count2++;
00059             wcount2 = count2 -1;
00060             }
00061             
00062             
00063             pc.printf("you typed: %s %s\n\r",user_command,user_command2);
00064             selection();
00065             clear();
00066             clear2();
00067     }
00068 }
00069     
00070     
00071