Use a touchscreen display to select which sensor measurement to display

Dependencies:   mbed DisplayModule24_demo_day10

Committer:
ldelaney17
Date:
Tue Jan 17 21:28:13 2017 +0000
Revision:
8:a7b7edb66de5
Parent:
4:3d5abdf9ad0e
final commit; cleaned up debug code; added comments; set 10s ticker period

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ldelaney17 3:4cd5469a146f 1 #ifndef TEMP_H
ldelaney17 3:4cd5469a146f 2 #define TEMP_H
ldelaney17 3:4cd5469a146f 3
ldelaney17 3:4cd5469a146f 4 extern I2C connection;
ldelaney17 3:4cd5469a146f 5 extern Serial pc;
ldelaney17 3:4cd5469a146f 6 const int temp_addr = 0x90;
ldelaney17 3:4cd5469a146f 7
ldelaney17 3:4cd5469a146f 8 //initialize the sensor
ldelaney17 3:4cd5469a146f 9 void temp_init();
ldelaney17 3:4cd5469a146f 10
ldelaney17 3:4cd5469a146f 11 //reads the current temperature and prints it in degrees Celsius if DEBUG_MODE is defined
ldelaney17 3:4cd5469a146f 12 float get_temp();
ldelaney17 3:4cd5469a146f 13
ldelaney17 4:3d5abdf9ad0e 14 //returns the average of n get_temp readings. If no n is provided, returns the average of 5 readings.
ldelaney17 4:3d5abdf9ad0e 15 float get_avg_temp(int n = 5);
ldelaney17 4:3d5abdf9ad0e 16
ldelaney17 3:4cd5469a146f 17 #endif