Latest
Dependencies: serial_terminal sample_hardware PLL_Config SDCard BMP280 Networkbits TextLCD SDBlockDevice
Diff: main.cpp
- Revision:
- 12:3a54cbaa714c
- Parent:
- 11:3ad0327e8c9f
- Child:
- 13:00545b1cb247
--- a/main.cpp Sun Nov 18 15:19:55 2018 +0000 +++ b/main.cpp Sun Nov 18 17:52:14 2018 +0000 @@ -6,6 +6,7 @@ #include "rtos.h" #include "events/mbed_events.h" #include "LCDdisplay.hpp" +#include "Clock.h" //Signals @@ -50,6 +51,8 @@ //TEST +Clock rtc; + int main() { pc = new RawSerial(USBTX, USBRX); @@ -65,10 +68,6 @@ SDcard(); - //Greeting - pc->printf("Testing\n\n"); - - //Power on self test post(); @@ -102,12 +101,13 @@ Thread::signal_wait(TAKE_SAMPLE); //needs to be a class at some point - + //read time also double temp = sensor.getTemperature(); double pressure = sensor.getPressure(); + float light = adcIn.read(); //Pass onto queues - LCDqueue.call(LCD_display,temp,pressure); + LCDqueue.call(LCD_display,temp,pressure,light); SDqueue.call(SDaddSample,temp,pressure); } } @@ -115,20 +115,16 @@ void serialISR() { pc->attach(NULL, Serial::RxIrq); - yellowLED = !yellowLED; serialqueue.call(serialiser); } void serialiser() -{ - +{ if (pc->readable()) { buffer[i] = pc->getc(); if (buffer[i] == '\r') { - //call serialterm - greenLED = !greenLED; i = 0; serialqueue.call(serialterm); @@ -137,5 +133,3 @@ } pc->attach(serialISR, Serial::RxIrq); } - -//