joseph adamu / Mbed OS CW_final_thr

Fork of CW_copy by Calvin Kalintra

Committer:
joseph_adamu
Date:
Wed Jan 10 09:50:29 2018 +0000
Revision:
1:dc648c5624b9
Parent:
0:4e623dbef4b8
version for export

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ckalintra 0:4e623dbef4b8 1 #include "mbed.h"
ckalintra 0:4e623dbef4b8 2 #include "TextLCD.h"
joseph_adamu 1:dc648c5624b9 3 #include "operation.h"
ckalintra 0:4e623dbef4b8 4 #include "BMP280.h"
joseph_adamu 1:dc648c5624b9 5 //#include "Networkbits.hpp"
ckalintra 0:4e623dbef4b8 6
ckalintra 0:4e623dbef4b8 7
joseph_adamu 1:dc648c5624b9 8 Ticker display; // timer interrupt
joseph_adamu 1:dc648c5624b9 9 Ticker second_pass; // timer interrupt
joseph_adamu 1:dc648c5624b9 10 InterruptIn button(USER_BUTTON); // setting the b;ue button on the board
joseph_adamu 1:dc648c5624b9 11 Thread t1,t2; // class allows defining, creating, and controlling thread functions in the system.
ckalintra 0:4e623dbef4b8 12
joseph_adamu 1:dc648c5624b9 13
ckalintra 0:4e623dbef4b8 14
ckalintra 0:4e623dbef4b8 15 int main()
ckalintra 0:4e623dbef4b8 16 {
joseph_adamu 1:dc648c5624b9 17 lcd.cls(); // clear lcd
joseph_adamu 1:dc648c5624b9 18 displaying_date_and_time(); // displayin the time and date
joseph_adamu 1:dc648c5624b9 19 while (cursor != 14) // while loop when cursor is not 14 it performs the function
ckalintra 0:4e623dbef4b8 20 {
joseph_adamu 1:dc648c5624b9 21 button_select_date();
ckalintra 0:4e623dbef4b8 22 }
joseph_adamu 1:dc648c5624b9 23 bmp280.initialize(); // intialisation of the BMP280 sesnor
joseph_adamu 1:dc648c5624b9 24 pc.printf("putty ready\n\r");
joseph_adamu 1:dc648c5624b9 25 display.attach(&dis_store_sensor_data, 2.0);
joseph_adamu 1:dc648c5624b9 26 button.rise(&disp_check);
joseph_adamu 1:dc648c5624b9 27 second_pass.attach(&tick, 1.0);
joseph_adamu 1:dc648c5624b9 28 t1.start(disp_putty); // start thread of the function disp_putty
joseph_adamu 1:dc648c5624b9 29 t2.start( disp_check); // start thread of the function disp_putty
joseph_adamu 1:dc648c5624b9 30 while(1)
joseph_adamu 1:dc648c5624b9 31 {
joseph_adamu 1:dc648c5624b9 32
joseph_adamu 1:dc648c5624b9 33 }
joseph_adamu 1:dc648c5624b9 34
ckalintra 0:4e623dbef4b8 35 }
joseph_adamu 1:dc648c5624b9 36