Dependencies:
BMP180
N5110
mbed
« Back to documentation index
main.h File Reference
header file containing functions and variables
More...
Go to the source code of this file.
Namespaces
namespace lcd
bus output for Nokia 5110 LCD screen
namespace bmp180
serial input for BMP180 sensor
namespace local
creates local file system to write files to
namespace leds
bus output for the two centre on-board leds
namespace buttonleft
interrupt in function for the left hand button
namespace BUT2
analog in function for the right hand button
namespace POT
analog in function for the potentiometer
namespace led
GPIO output for error LED.
namespace buzzer
PWM output for piezo buzzer.
namespace LDR
analog input for the light dependant resistor
Functions
void timerTExpired ()
Expire Timer T; timer associated with temperature; sets timerTFlag to one.
void timerPExpired ()
Expire Timer P; timer associated with pressure; sets timerPFlag to one.
void timerEExpired ()
Expire Timer E; timer associated with error LED; sets timerEFlag to one.
void timerLEpired ()
Expire Timer L; timer associated with error LED; sets timerLFlag to one.
void buttonPressed ()
Press Button; interrupt associated with left button; sets buttonFlag to one.
void error ()
Error Function; function supplies error function; LED lights up every 2 seconds; buzzer goes off simultaneously with the LED.
void writeDataToFile ()
Write Data To File; function to write data to the flash drive.
void callTemp ()
Calls Temperature; function reads the temperature from the sensor; prints the current temperature to the screen.
void callPress ()
Calls Pressure; function reads the pressure from the sensor; prints the current pressure to the screen.
void callLight ()
Calls Light; function reads the light from the LDR ; prints the current temperature to the screen.
void readTemp ()
Read Temperature; calls callTemp after 0.1 seconds; reads temperature every 60 seconds; prints temperature to screen; updates screen every 60 seconds with new temperature.
void readPress ()
Read Pressure; calls callPress after 0.1 seconds; reads pressure every 30 minutes/1800 seconds; prints pressure to screen; updates screen every 30 minutes with new pressure.
void readLight ()
Read Light; calls callLight after 0.1 seconds; reads light every 60 seconds; prints light to screen; updates screen every 60 seconds with new light.
void measurement ()
Measurement; read measurement from sensor; set temperature; set pressure.
void tempGraph ()
Temperature Graph; read temperature every 2 seconds; create temporary array; read temperature values into array; scale temperature array; plot array.
void pressGraph ()
Pressure Graph; read pressure every 2 seconds; create temporary array; read pressure values into array; scale pressure array; plot array.
void lightGraph ()
Light Graph; read light every 2 seconds; create temporary array; read light values into array; scale light array; plot array.
void menu ()
Menu; print temperature screen if potentiometer is greater than 2/3; print pressure screen if potentiometer is between 1/3 and 2/3; print light screen if potentiometer is less than 1/3.
void clearCells ()
Clear Cells; cycle through pixels and set to zero.
Variables
int nx = 84
Sets x axis of screen.
int ny = 48
Sets y axis of screen.
int i
Coordinates of a pixel.
float temperature
initialising a decimal variable
float pressure
initialising a decimal variable
int counter = 0
initialise the counter as an integer
int buttonFlag = 0
initialise the flag for the button
Timeout callT
timeout used for temperature
Timeout callP
timeout used for pressure
Timeout callL
timeout used for light
Ticker timerT
ticker function for temperature
Ticker timerP
ticker function for pressure
Ticker timerE
ticker function for error
Ticker timerL
ticker function for light
int timerTFlag = 0
initialise flag for temperature
int timerPFlag = 0
initialise flag for pressure
int timerEFlag = 0
initialise flag for error
int timerLFlag = 0
initialise flag for light
Detailed Description
header file containing functions and variables
Revision 1.0
Author: Orla Gilson
Date: May 2015
Definition in file main.h .
Function Documentation
Press Button; interrupt associated with left button; sets buttonFlag to one.
Definition at line 30 of file main.cpp .
Calls Light; function reads the light from the LDR ; prints the current temperature to the screen.
Definition at line 85 of file main.cpp .
Calls Pressure; function reads the pressure from the sensor; prints the current pressure to the screen.
Definition at line 71 of file main.cpp .
Calls Temperature; function reads the temperature from the sensor; prints the current temperature to the screen.
Definition at line 57 of file main.cpp .
Clear Cells; cycle through pixels and set to zero.
Definition at line 335 of file main.cpp .
Error Function; function supplies error function; LED lights up every 2 seconds; buzzer goes off simultaneously with the LED.
Definition at line 34 of file main.cpp .
Light Graph; read light every 2 seconds; create temporary array; read light values into array; scale light array; plot array.
Definition at line 247 of file main.cpp .
Measurement; read measurement from sensor; set temperature; set pressure.
Definition at line 180 of file main.cpp .
Menu; print temperature screen if potentiometer is greater than 2/3; print pressure screen if potentiometer is between 1/3 and 2/3; print light screen if potentiometer is less than 1/3.
Definition at line 277 of file main.cpp .
Pressure Graph; read pressure every 2 seconds; create temporary array; read pressure values into array; scale pressure array; plot array.
Definition at line 217 of file main.cpp .
Read Light; calls callLight after 0.1 seconds; reads light every 60 seconds; prints light to screen; updates screen every 60 seconds with new light.
Definition at line 153 of file main.cpp .
Read Pressure; calls callPress after 0.1 seconds; reads pressure every 30 minutes/1800 seconds; prints pressure to screen; updates screen every 30 minutes with new pressure.
Definition at line 126 of file main.cpp .
Read Temperature; calls callTemp after 0.1 seconds; reads temperature every 60 seconds; prints temperature to screen; updates screen every 60 seconds with new temperature.
Definition at line 99 of file main.cpp .
Temperature Graph; read temperature every 2 seconds; create temporary array; read temperature values into array; scale temperature array; plot array.
Definition at line 187 of file main.cpp .
Expire Timer E; timer associated with error LED; sets timerEFlag to one.
Definition at line 22 of file main.cpp .
Expire Timer L; timer associated with error LED; sets timerLFlag to one.
Expire Timer P; timer associated with pressure; sets timerPFlag to one.
Definition at line 18 of file main.cpp .
Expire Timer T; timer associated with temperature; sets timerTFlag to one.
Definition at line 14 of file main.cpp .
Write Data To File; function to write data to the flash drive.
Variable Documentation
initialise the flag for the button
Definition at line 114 of file main.h .
timeout used for light
Definition at line 129 of file main.h .
timeout used for pressure
Definition at line 124 of file main.h .
timeout used for temperature
Definition at line 119 of file main.h .
initialise the counter as an integer
Definition at line 109 of file main.h .
Coordinates of a pixel.
Parameters:
i - x value of coordinate (0-83)
j - y value of coordinate (0-47
Definition at line 94 of file main.h .
Sets x axis of screen.
Parameters:
Definition at line 81 of file main.h .
Sets y axis of screen.
Parameters:
Definition at line 87 of file main.h .
initialising a decimal variable
Definition at line 104 of file main.h .
initialising a decimal variable
Definition at line 99 of file main.h .
ticker function for error
Definition at line 144 of file main.h .
initialise flag for error
Definition at line 164 of file main.h .
ticker function for light
Definition at line 149 of file main.h .
initialise flag for light
Definition at line 169 of file main.h .
ticker function for pressure
Definition at line 139 of file main.h .
initialise flag for pressure
Definition at line 159 of file main.h .
ticker function for temperature
Definition at line 134 of file main.h .
initialise flag for temperature
Definition at line 154 of file main.h .