Software hold - Team 1 - PRO2 2017 / Mbed 2 deprecated PRO2_samlet_kode

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 //Defining and Including stuff up here
00002 #include <mbed.h>
00003 #include "SHTx/sht15.hpp"
00004 #define temperature_low         //For use in the Data Analysis
00005 #define temperature_high        //For use in the Data Analysis
00006 #include "rgb_led.h"            //For use in the RGB_LED_output part
00007 #include "7_segment_control.h"  //For use in the RGB_LED_output part
00008 
00009 // MAIN er ikke færdig rettet!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
00010 
00011 
00012 //Prototype definitions
00013 void Logging(); //Prototype for Logging
00014 void Hibernation();
00015 void Settings();
00016 void Comparevalues();
00017 void rgb_outp();
00018 
00019 
00020 //The correct order of files:
00021 
00022 //Declaration of GLOBAL VARIABLES:
00023 float temperature, humidity;            //this will be data read from sensor
00024 void GetTemperatureAndHumidity();
00025 int i,t,set_temp,timespan,status;
00026 
00027 Serial pc(USBTX, USBRX);
00028 //DigitalOut busy(LED1);                 
00029 InterruptIn event(USER_BUTTON);
00030 DigitalOut myled(LED1);
00031 DigitalIn up(PA_5);
00032 DigitalIn down(PA_6);
00033 
00034 
00035 //ports on the Nucleo: PB_8, PB_9
00036 SHTx::SHT15 sensor(PB_8, PB_9);
00037 
00038 
00039 
00040 int main()
00041 {
00042 
00043     Logging();
00044 
00045     Settings();
00046     
00047     GetTemperatureAndHumidity();        //Data Collection
00048 
00049     Comparevalues( );                   //Data Analysis
00050 
00051     rgb_outp(status);                   //RGB_LED_output
00052 
00053     return 0;
00054 }