Uses the SRF02 UDS and displays distance in a variety of ways on the N5110 LCD.
Dependencies: N5110WN PowerControl SRF02 mbed
Diff: main.h
- Revision:
- 5:f9b97f057836
- Parent:
- 4:2e9aa626a02c
- Child:
- 6:a5cd7eb72264
--- a/main.h Wed Apr 08 00:46:27 2015 +0000 +++ b/main.h Wed Apr 08 19:54:03 2015 +0000 @@ -23,11 +23,7 @@ @brief An Interrupt button that toggles the Unit */ InterruptIn UnitTog(p14); -/** -@namespace LCDTog -@brief A SPDT switch that turns the LCD Screen on/off -*/ -AnalogIn LCDTog(p15); + /** @namespace LogTog @brief An Interrupt button that toggles the Logging Capabilities @@ -96,7 +92,6 @@ // ---- Variables ---- -float scanSpeed=1; /*!< float that changes the speed that the distance is taken */ float volume=1; /*!< float used to vary the volume */ int distance; /*!< integer that stores the distance */ float unitX=1; /*!< Float that stores the unit multiple if 1 unit is cm, 0.01 = m, 10 = mm */ @@ -105,16 +100,23 @@ // ---- Flags ---- int timerFlag=0; /*!< flag used to trigger the timer ISR */ +int timer2Flag=0; /*!< flag used to trigger the 2nd timer ISR */ +int timer3Flag=0; /*!< flag used to trigger the 3nd timer ISR */ int setTimeFlag = 0; /*!< flag for ISR for setting time */ int logButtonFlag = 0; /*!<flag for button toggle */ // ---- MISC ---- +char buffer[30]; /*!<buffer used to store time string */ char rxString[16]; /*!< buffer to store received string */ LocalFileSystem local("local"); /*!< create local filesystem */ -Ticker timer; +Ticker timer; /*!< timer for first speed */ +Ticker timer2;/*!< timer for second speed */ +Ticker timer3;/*!< timer for third speed */ // ---- functions ---- + +void theMain(); /** deals with the visual and audiable alerts. */ @@ -137,9 +139,14 @@ */ void timerExpired(); /** -sets the speed of the scanning, dependant on the distance +ISR used for the 2nd timer */ -void setScanSpeed(); +void timer2Expired(); +/** +ISR used for the 3rd timer +*/ +void timer3Expired(); + /** Displays an error message on the Mbed LEDs @brief The error message show is up to 14. IF 15 shown it is a ack bit error for the SRF02 @@ -196,62 +203,6 @@ */ void car(); -/** -sets the number 0 in pixels -@param P - Positional Modifier -*/ -void number0(int P); -/** -sets the number 1 in pixels -@param P - Positional Modifier -*/ -void number1(int P); -/** -sets the number 2 in pixels -@param P - Positional Modifier -*/ -void number2(int P); -/** -sets the number 3 in pixels -@param P - Positional Modifier -*/ -void number3(int P); -/** -sets the number 4 in pixels -@param P - Positional Modifier -*/ -void number4(int P); -/** -sets the number 5 in pixels -@param P - Positional Modifier -*/ -void number5(int P); -/** -sets the number 6 in pixels -@param P - Positional Modifier -*/ -void number6(int P); -/** -sets the number 7 in pixels -@param P - Positional Modifier -*/ -void number7(int P); -/** -sets the number 8 in pixels -@param P - Positional Modifier -*/ -void number8(int P); -/** -sets the number 9 in pixels -@param P - Positional Modifier -*/ -void number9(int P); -/** -sets the Decimal for the metre units -*/ -void decimal(); - - typedef const struct State STyp; /*!< defines the struct type */ /** Sets the struct