Alix & Sam's combined versions
Dependencies: BMP280 ELEC350-Practicals-FZ429 TextLCD BME280 ntp-client
Diff: main.cpp
- Revision:
- 10:eea19f8e6122
- Parent:
- 9:f5eae5211225
--- a/main.cpp Fri Dec 07 13:24:50 2018 +0000 +++ b/main.cpp Thu Dec 13 15:24:22 2018 +0000 @@ -7,8 +7,9 @@ void LCD_Thread(void); void SAMP_Thread(void); void SERIAL_Thread(void); +void Network_Thread(void); -Thread tLCD, tSAMP, tSERIAL, tSD; +Thread tLCD, tSAMP, tSERIAL, tSD, tNET; // Define member object Sampler m_oSample; @@ -18,6 +19,7 @@ tLCD.start(LCD_Thread); tSAMP.start(SAMP_Thread); tSERIAL.start(SERIAL_Thread); + tNET.start(Network_Thread); Thread::wait(osWaitForever); } @@ -26,7 +28,8 @@ { while(1) { - m_oDisplay.LCD_Queue.call_every(1000, &m_oDisplay, &LCD_Data::display_LCD); //displays the current sensor information onto the LCD screen every x miliseconds + //m_oDisplay.LCD_Queue.call(&m_oDisplay, &LCD_Data::update_time_date); + m_oDisplay.LCD_Queue.call_every(1000, &m_oDisplay, &LCD_Data::display_LCD); //displays the current sensor information onto the LCD screen every x miliseconds m_oDisplay.LCD_Queue.dispatch(); //dispatches the above tasks to the queue, then blocks main forever unless ' break_dispatch () ' is used while(true) { @@ -70,3 +73,24 @@ } } + + + void Network_Thread() +{ + while(1) + { + m_oNet.Network_Queue.call_every(10, &m_oNet, &Network::NetPush); + m_oNet.Network_Queue.dispatch(); + + while(true) + { // Flash if the event queue is exited. + greenLED = 1; + wait(0.5); + greenLED = 0; + wait(0.1); + + } + } +} + +