Embedded Systems Project Mateusz Loboda 200843098
Dependencies: N5110 SRF02-Mateusz mbed
main.h@0:3403a3415306, 2016-05-04 (annotated)
- Committer:
- el14ml
- Date:
- Wed May 04 10:58:52 2016 +0000
- Revision:
- 0:3403a3415306
- Child:
- 2:0dfa60f22f07
04/05 everything works
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el14ml | 0:3403a3415306 | 1 | /** |
el14ml | 0:3403a3415306 | 2 | @file main.h |
el14ml | 0:3403a3415306 | 3 | @brief ʜeader file declares functions and variables |
el14ml | 0:3403a3415306 | 4 | @brief ʀeverse Parking Tool... |
el14ml | 0:3403a3415306 | 5 | @brief ʀevision 1.0 |
el14ml | 0:3403a3415306 | 6 | @author Mateusz Loboda |
el14ml | 0:3403a3415306 | 7 | @Date 02/05/16 |
el14ml | 0:3403a3415306 | 8 | */ |
el14ml | 0:3403a3415306 | 9 | |
el14ml | 0:3403a3415306 | 10 | #ifndef MAIN_H |
el14ml | 0:3403a3415306 | 11 | #define MAIN_H |
el14ml | 0:3403a3415306 | 12 | #include "N5110.h" |
el14ml | 0:3403a3415306 | 13 | #include "SRF02.h" |
el14ml | 0:3403a3415306 | 14 | |
el14ml | 0:3403a3415306 | 15 | |
el14ml | 0:3403a3415306 | 16 | N5110 lcd(PTE26 , PTA0 , PTC4 , PTD0 , PTD2 , PTD1 , PTC3); |
el14ml | 0:3403a3415306 | 17 | SRF02 sensor(I2C_SDA,I2C_SCL); |
el14ml | 0:3403a3415306 | 18 | |
el14ml | 0:3403a3415306 | 19 | DigitalOut r_led(LED_RED); |
el14ml | 0:3403a3415306 | 20 | DigitalOut g_led(LED_GREEN); |
el14ml | 0:3403a3415306 | 21 | DigitalOut b_led(LED_BLUE); |
el14ml | 0:3403a3415306 | 22 | InterruptIn button2(PTB18); |
el14ml | 0:3403a3415306 | 23 | InterruptIn button1(PTB9); |
el14ml | 0:3403a3415306 | 24 | PwmOut buzzer(PTA2); |
el14ml | 0:3403a3415306 | 25 | AnalogIn rate(PTB10); |
el14ml | 0:3403a3415306 | 26 | DigitalOut myled(PTC2); |
el14ml | 0:3403a3415306 | 27 | Ticker ticker; // pot delay, periodic interrupt |
el14ml | 0:3403a3415306 | 28 | //InterruptIn button2(PTB23); |
el14ml | 0:3403a3415306 | 29 | |
el14ml | 0:3403a3415306 | 30 | Timeout out; // |
el14ml | 0:3403a3415306 | 31 | |
el14ml | 0:3403a3415306 | 32 | volatile int g_button1_flag = 0; |
el14ml | 0:3403a3415306 | 33 | volatile int g_button2_flag = 0; |
el14ml | 0:3403a3415306 | 34 | volatile int g_ticker_flag = 0; |
el14ml | 0:3403a3415306 | 35 | void units(); |
el14ml | 0:3403a3415306 | 36 | void mode(); |
el14ml | 0:3403a3415306 | 37 | void timeout_isr(); |
el14ml | 0:3403a3415306 | 38 | void ticker_isr(); |
el14ml | 0:3403a3415306 | 39 | void init_K64F(); |
el14ml | 0:3403a3415306 | 40 | void initialScreen(); |
el14ml | 0:3403a3415306 | 41 | void initialArray(); |
el14ml | 0:3403a3415306 | 42 | void get_averageDistance(); |
el14ml | 0:3403a3415306 | 43 | void redLedIndicator(); |
el14ml | 0:3403a3415306 | 44 | void drawDistanceBars(); |
el14ml | 0:3403a3415306 | 45 | void moveArrayElements(); |
el14ml | 0:3403a3415306 | 46 | void adjacentArrayElements(); |
el14ml | 0:3403a3415306 | 47 | void plotAxes(); |
el14ml | 0:3403a3415306 | 48 | void plotDistancePoint(); |
el14ml | 0:3403a3415306 | 49 | void modeTwo(); |
el14ml | 0:3403a3415306 | 50 | |
el14ml | 0:3403a3415306 | 51 | |
el14ml | 0:3403a3415306 | 52 | |
el14ml | 0:3403a3415306 | 53 | float buzzerPeriod; |
el14ml | 0:3403a3415306 | 54 | float delay; |
el14ml | 0:3403a3415306 | 55 | float averageDistance; |
el14ml | 0:3403a3415306 | 56 | float graphArray[82]; |
el14ml | 0:3403a3415306 | 57 | |
el14ml | 0:3403a3415306 | 58 | #endif |