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:
- 2:a1eaa4d74b63
- Parent:
- 1:7f151ab172cb
- Child:
- 3:00933efbe463
--- a/main.h Fri Mar 20 11:46:08 2015 +0000 +++ b/main.h Fri Mar 20 17:25:39 2015 +0000 @@ -101,7 +101,7 @@ 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 */ int U=0; /*!< integer used to define the units. if 0 cm, 1 is m, 2 is mm */ -//string units; +const char *units ="cm"; // ---- Flags ---- int timerFlag=0; /*!< flag used to trigger the timer ISR */ @@ -151,7 +151,9 @@ void setTime(); // function to set the UNIX time +void introTune(); +void checkerBoard(); typedef const struct State STyp; /*!< defines the struct type */ /** @@ -159,7 +161,7 @@ */ struct State { float unitMultiple; /*!< float that stores the unit mulitple */ - // Unit; /*!<stores the sting value of the unit */ + const char *Unit; /*!<stores the sting value of the unit */ int nextState[2]; /*!< array of next states */ }; @@ -167,9 +169,9 @@ @brief sets the Finite State Machine for the Unit toggle. */ STyp fsm[3] = { - {1,{0,1}}, /*!< State 0: stays in the current state unless input is recieved */ - {0.01,{1,2}}, /*!< State 1: stays in the current state unless input is recieved */ - {10,{2,0}} /*!< State 2: stays in the current state unless input is recieved */ + {1,"cm",{0,1}}, /*!< State 0: stays in the current state unless input is recieved */ + {0.01,"m",{1,2}}, /*!< State 1: stays in the current state unless input is recieved */ + {10,"mm",{2,0}} /*!< State 2: stays in the current state unless input is recieved */ }; int state=0;/*!< sets the initial state */