A program designed to get the distance from an SRF02 distance sensor and create an audible and visual indication of that distance with data logging capabilities.
Dependencies: N5110 PowerControl SRF02 mbed
Diff: main.h
- Revision:
- 4:0bd5c189f2f3
- Parent:
- 2:ebcfecb68cca
- Child:
- 6:d6afc4026a1d
--- a/main.h Wed Apr 08 20:21:54 2015 +0000 +++ b/main.h Thu Apr 09 09:49:06 2015 +0000 @@ -21,20 +21,20 @@ BusOut leds (LED1,LED2,LED3,LED4); //MBED onboard LEDs. Serial pc(USBTX,USBRX); -LocalFileSystem local("local"); // create local filesystem -void writeDataToFile(char* data, float Distancedata); //Creates the void which takes the two types of data into the function. - Ticker timer; int timerflag = 0; //initialise timer flag to equal 0. -int distance = 0; +int distance = 0; //initialise distance to equal 0. int buttonFlag = 0; //initialise buttonFlag to be 0, which defines the state of the data logger. +int setTimeFlag = 0; //initialise setTimeFlag to equal 0. +int mode = 0; //initialise mode to equal 0 (normal mode) char rxString[16]; // buffer to store received string -int light =0; -int setTimeFlag = 0; -void modeSwitch(); -void error(int code); -void timerExpired(); -float avgDist(); -void buttonISR(); \ No newline at end of file +LocalFileSystem local("local"); // create local filesystem +void writeDataToFile(char* data, float Distancedata); //Creates the void which takes the two types of data into the function. + +void barChart(); //Function to update the bar chart on the display. +void error(int code); //DEBUG: Error Function +void timerExpired(); //Function for when the timer expires. +float avgDist(); //Function to get the average distance. +void buttonPressed(); //Function to change mode once button is pressed. \ No newline at end of file