Version 8, working version with Alix, sams and ollies code. Displays time, date and sensor info onto terminal, LCD and networking, and saves onto SD card.

Dependencies:   BMP280 ELEC350-Practicals-FZ429 TextLCD BME280 ntp-client

SerialComms.hpp

Committer:
Alix955
Date:
2018-12-31
Revision:
12:4c7eaac8ceef
Parent:
8:7d218affea71

File content as of revision 12:4c7eaac8ceef:

#include "mbed.h"

class Serialcomms
{
    private:
         float fTemp;      //current temperature of sensor
         float fPressure;  //current pressure of sensor
         float fLDR;      //current light level from LDR
         
    public:
        EventQueue SERIAL_Queue;                   //Initialise the EventQueue
   
        void setsampledata(sample_message msg)      // Update internal values
        {
            fTemp = msg.temp;
            fPressure = msg.pressure;
            fLDR = msg.ldr;   
        }
        
        sample_message getsampledata()          // Retrieves the data
        {
            sample_message msg;
            msg.temp = fTemp;
            msg.pressure = fPressure;
            msg.ldr = fLDR;
            return msg;
        }
        
        void updateTerminal()                   // Print internal values of sensors
        {            
            printf("======= Sensor Update ========\n");
            printf("Temperate: %5.2f\n", fTemp);
            printf("Pressure: %5.2f\n", fPressure);
            printf("Light Level: %5.2f\n", fLDR);
            printf("==============================\n");              
        }
    
        void updateTimeDate()
        {
        }
        
        Serialcomms()
        {
            printf("Serial Comms Initialised\n");
        }
        ~Serialcomms()
        {
        }  
};

Serialcomms m_oSerial;