PRO2_Team 1_collected code with ticker and headers_not working yet
Fork of PRO2_samlet_kode by
Revision 11:3ff48fb0aa0b, committed 2017-06-20
- Comitter:
- OlgaHoeyer
- Date:
- Tue Jun 20 12:18:09 2017 +0000
- Parent:
- 10:aafbe309f53a
- Commit message:
- with pointers
Changed in this revision
diff -r aafbe309f53a -r 3ff48fb0aa0b Settings.cpp --- a/Settings.cpp Tue May 30 12:52:39 2017 +0000 +++ b/Settings.cpp Tue Jun 20 12:18:09 2017 +0000 @@ -24,9 +24,9 @@ extern int timespan; int t; int i, set_temp; -int temperature_low,temperature_high; +//int temperature_low,temperature_high; -int main() +void Settings(int *temperature_low, int *temperature_high) { while(i<1) { //Open set_temp for user input. @@ -44,8 +44,8 @@ } } - int temperature_low = (set_temp-3); - int temperature_high = (set_temp+3); + *temperature_low = (set_temp-3); + *temperature_high = (set_temp+3); /* Temperature that defines what uncomfortable */
diff -r aafbe309f53a -r 3ff48fb0aa0b Settings.h --- a/Settings.h Tue May 30 12:52:39 2017 +0000 +++ b/Settings.h Tue Jun 20 12:18:09 2017 +0000 @@ -11,8 +11,8 @@ -- -- Description: User input for temp. -- --- Usage: Settings(); +-- Usage: ------------------------------------------------------------------------------- */ -void Settings(); \ No newline at end of file +void Settings(int *a, int *b); \ No newline at end of file
diff -r aafbe309f53a -r 3ff48fb0aa0b compare.h --- a/compare.h Tue May 30 12:52:39 2017 +0000 +++ b/compare.h Tue Jun 20 12:18:09 2017 +0000 @@ -15,8 +15,8 @@ -- on temperature and evaluate air quality. -- Output is status (int, from 1 to 5). -- --- Usage: Compare_values(float hum, float temp, --- int temperature_low, int temperature_high) +-- Usage: Compare_values (hum, temp, +-- temperature_low, temperature_high) ------------------------------------------------------------------------------- */
diff -r aafbe309f53a -r 3ff48fb0aa0b main.cpp --- a/main.cpp Tue May 30 12:52:39 2017 +0000 +++ b/main.cpp Tue Jun 20 12:18:09 2017 +0000 @@ -39,8 +39,7 @@ float temperature, humidity; //this will be data read from sensor void GetTemperatureAndHumidity(); //via denne function -int temperature_low=18; //DELETE LATER! -int temperature_high=22; //DELETE LATER! + int temp_digit1=2; //DELETE LATER! int temp_digit2=5; //DELETE LATER! @@ -67,16 +66,18 @@ int main() { - tick1.attach(&Settings(), 20); //Settings + int temperature_low=0; //DE! + int temperature_high=0; //DELE + //tick1.attach(&Settings(), 20); //Settings tick2.attach(&GetTemperatureAndHumidity(),6000); //Data Collection 6000 ms = 1 (min)*60(sec)*100(ms) while(1) { - Settings(); //skal returnere: temperature_low, temperature_high, temp_digit1, temp_digit2 + Settings(&t_low, &tmp_high); //skal returnere: temperature_low, temperature_high, temp_digit1, temp_digit2 segment_7(); segment_7::show(temp_digit1,3); segment_7::show(temp_digit2,3); - GetTemperatureAndHumidity(); //returnerer humidity; temperature + // GetTemperatureAndHumidity(); //returnerer humidity; temperature status=Compare_values(humidity, temperature, temperature_low, temperature_high); rgb_outp(status); logging ();