Embedded Systems Project Mateusz Loboda 200843098
Dependencies: N5110 SRF02-Mateusz mbed
Diff: main.h
- Revision:
- 3:ee005c9f0348
- Parent:
- 2:0dfa60f22f07
--- a/main.h Wed May 04 22:45:02 2016 +0000 +++ b/main.h Thu May 05 09:54:30 2016 +0000 @@ -7,35 +7,40 @@ @Date 02/05/16 */ + #ifndef MAIN_H #define MAIN_H +#include "mbed.h" #include "N5110.h" #include "SRF02.h" /** @namespace lcd -@brief object of the N5110 class +@brief Object of the N5110 class */ N5110 lcd(PTE26 , PTA0 , PTC4 , PTD0 , PTD2 , PTD1 , PTC3); -////////////////// +/** +@namespace sensor +@brief Object of the SRF02 class +*/ SRF02 sensor(I2C_SDA,I2C_SCL); /** @namespace r_led -@brief output for status of red LED +@brief Output for status of red LED */ DigitalOut r_led(LED_RED); /** @namespace g_led -@brief output for status of green LED +@brief Output for status of green LED */ DigitalOut g_led(LED_GREEN); /** @namespace b_led -@brief output for status of blue LED +@brief Output for status of blue LED */ DigitalOut b_led(LED_BLUE); @@ -53,13 +58,13 @@ /** @namespace buzzer -@brief use PWM pin to control the volume of the buzzer, duty cycle and period +@brief Use PWM pin to control the volume of the buzzer, duty cycle and period */ PwmOut buzzer(PTA2); /** @namespace pot -@brief read value of the potentiometer from the potentiometer position +@brief Read value of the potentiometer from the potentiometer position */ AnalogIn rate(PTB10); @@ -90,40 +95,40 @@ /** The main function where the code is executed */ -//int main(); +int main(); /** -setting up flag to 1 +setting flag to 1 */ void units(); /** -setting up flag to 1 +setting flag to 1 */ void mode(); /** -setting up flag to 1 +setting flag to 1 */ void timeout_isr(); /** -setting up flag to 1 +setting flag to 1 */ void ticker_isr(); /** -setting up the buttons and on board LEDs +Setting up the buttons and on board LEDs */ void init_K64F(); /** -inital screen printed +Inital screen printed */ void initialScreen(); /** -initialize graph array for distance points +Initialize graph array for distance points */ void initialArray(); @@ -164,9 +169,16 @@ //void modeTwo(); +/// equation which relates the average distance to the frequency of the buzzer float buzzerPeriod; + +/// output value of the potentiometer used to control buzzer volume float delay; + +/// average of multiple consecutive distance readings float averageDistance; + +/// initialize graph array, 2 pixels used for a and y axis hence array not 84 float graphArray[82]; #endif \ No newline at end of file