joseph adamu / Mbed OS CW_final_thr

Fork of CW_copy by Calvin Kalintra

main.cpp

Committer:
ckalintra
Date:
2018-01-03
Revision:
0:4e623dbef4b8
Child:
1:dc648c5624b9

File content as of revision 0:4e623dbef4b8:

#include "mbed.h"
#include "TextLCD.h"
#include "BMP280.h"
#include "putty.h"
#include"date.h"
//DigitalOut myled(LED1);


Ticker display;


void lcddisp()
{ 
    getdata();
    store();
    lcd.cls();
    display_time();
    lcd.locate(10,0);
    lcd.printf("l:%1.2f", lvl);
    lcd.locate(0,0);
    lcd.printf("p:%3.1f", pressuref);
    lcd.locate(10,1);
    lcd.printf("t:%3.1f", tempf);
}



int main()
{
    lcd.cls();
    display_date();
    while (pointer != 14)
    {
        select_date();
    }
    bmp.initialize();
    pc.printf("putty ready\n\r");
    display.attach(&lcddisp, 2.0);
    while(1)
    {
            int count = 0;
            int wcount = 0;
            //char c[20] = {0};
            //char c2[20] = {0};
            while (user_command[wcount]!= ' ')
            {
            user_command[count] = pc.getc();
            pc.putc(user_command[count]);
            count++;
            wcount = count -1;
            }
            int count2 = 0;
            int wcount2 = 0;
            while(user_command2[wcount2]!= '\r')
            {
            user_command2[count2] = pc.getc();
            pc.putc(user_command2[count2]);
            count2++;
            wcount2 = count2 -1;
            }
            
            
            pc.printf("you typed: %s %s\n\r",user_command,user_command2);
            selection();
            clear();
            clear2();
    }
}