PRO2_Team 1_collected code with ticker_not working yet

Dependencies:   SHTx mbed

Fork of PRO2_samlet_kode by Software hold - Team 1 - PRO2 2017

Committer:
OlgaHoeyer
Date:
Thu May 18 22:34:57 2017 +0000
Revision:
1:135bd458e39e
Parent:
0:21e9cc38dd31
Child:
2:0864be57f81e
half finished modular design

Who changed what in which revision?

UserRevisionLine numberNew contents of line
OlgaHoeyer 0:21e9cc38dd31 1 //Defining and Including stuff up here
OlgaHoeyer 0:21e9cc38dd31 2 #include <mbed.h>
OlgaHoeyer 1:135bd458e39e 3 #include "SHTx/sht15.hpp"
OlgaHoeyer 1:135bd458e39e 4 #define temperature_low //For use in the Data Analysis
OlgaHoeyer 1:135bd458e39e 5 #define temperature_high //For use in the Data Analysis
OlgaHoeyer 0:21e9cc38dd31 6 #include "rgb_led.h" //For use in the RGB_LED_output part
OlgaHoeyer 0:21e9cc38dd31 7 #include "7_segment_control.h" //For use in the RGB_LED_output part
OlgaHoeyer 0:21e9cc38dd31 8
OlgaHoeyer 1:135bd458e39e 9 // MAIN er ikke færdig rettet!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
OlgaHoeyer 1:135bd458e39e 10
OlgaHoeyer 1:135bd458e39e 11
OlgaHoeyer 1:135bd458e39e 12 //Prototype definitions
OlgaHoeyer 1:135bd458e39e 13 void Logging(); //Prototype for Logging
OlgaHoeyer 1:135bd458e39e 14 void Hibernation();
OlgaHoeyer 1:135bd458e39e 15 void Settings();
OlgaHoeyer 1:135bd458e39e 16 void Comparevalues();
OlgaHoeyer 1:135bd458e39e 17 void rgb_outp();
OlgaHoeyer 1:135bd458e39e 18
OlgaHoeyer 0:21e9cc38dd31 19
OlgaHoeyer 0:21e9cc38dd31 20 //The correct order of files:
OlgaHoeyer 0:21e9cc38dd31 21
OlgaHoeyer 0:21e9cc38dd31 22 //Declaration of GLOBAL VARIABLES:
OlgaHoeyer 0:21e9cc38dd31 23 float temperature, humidity; //this will be data read from sensor
OlgaHoeyer 0:21e9cc38dd31 24 void GetTemperatureAndHumidity();
OlgaHoeyer 1:135bd458e39e 25 int i,t,set_temp,timespan,status;
OlgaHoeyer 1:135bd458e39e 26
OlgaHoeyer 1:135bd458e39e 27 Serial pc(USBTX, USBRX);
OlgaHoeyer 1:135bd458e39e 28 //DigitalOut busy(LED1);
OlgaHoeyer 1:135bd458e39e 29 InterruptIn event(USER_BUTTON);
OlgaHoeyer 1:135bd458e39e 30 DigitalOut myled(LED1);
OlgaHoeyer 1:135bd458e39e 31 DigitalIn up(PA_5);
OlgaHoeyer 1:135bd458e39e 32 DigitalIn down(PA_6);
OlgaHoeyer 1:135bd458e39e 33
OlgaHoeyer 1:135bd458e39e 34
OlgaHoeyer 0:21e9cc38dd31 35 //ports on the Nucleo: PB_8, PB_9
OlgaHoeyer 0:21e9cc38dd31 36 SHTx::SHT15 sensor(PB_8, PB_9);
OlgaHoeyer 0:21e9cc38dd31 37
OlgaHoeyer 0:21e9cc38dd31 38
OlgaHoeyer 0:21e9cc38dd31 39
OlgaHoeyer 1:135bd458e39e 40 int main()
OlgaHoeyer 1:135bd458e39e 41 {
OlgaHoeyer 1:135bd458e39e 42
OlgaHoeyer 0:21e9cc38dd31 43 Logging();
OlgaHoeyer 1:135bd458e39e 44
OlgaHoeyer 0:21e9cc38dd31 45 Settings();
OlgaHoeyer 0:21e9cc38dd31 46
OlgaHoeyer 1:135bd458e39e 47 GetTemperatureAndHumidity(); //Data Collection
OlgaHoeyer 0:21e9cc38dd31 48
OlgaHoeyer 1:135bd458e39e 49 Comparevalues( ); //Data Analysis
OlgaHoeyer 0:21e9cc38dd31 50
OlgaHoeyer 1:135bd458e39e 51 rgb_outp(status); //RGB_LED_output
OlgaHoeyer 1:135bd458e39e 52
OlgaHoeyer 1:135bd458e39e 53 return 0;
OlgaHoeyer 0:21e9cc38dd31 54 }