Coding for vehicle rear assistant
Fork of Vehicle_Rear_Assistant by
main.h File Reference
Header file containing functions prototypes, defines and global variables. More...
Go to the source code of this file.
Namespaces | |
namespace | lcd |
GPIO pins for LCD display. | |
namespace | sensor |
GPIO pins for SRF02. | |
namespace | buzzer |
PWM pin for piezo buzzer. | |
namespace | danger |
PWM pin for RED LED. | |
namespace | caution |
PWM pin for YELLOW LED. | |
namespace | safe |
PWM pin for GREEN LED. | |
namespace | lcdBrightness |
PWM pin for LCD backlight. | |
namespace | potBrightness |
AnalogIn pin for potentiometer. | |
namespace | button |
InterruptIn pin for button. | |
Functions | |
void | welcomeText () |
Print welcome message when switch is turned on. | |
void | getDistance () |
Measure distance between car and objects. | |
void | readDistance () |
Print "CAR" and a block on LCD according to distance measured. | |
void | distanceSafe () |
This function is called when in safe mode. | |
void | distanceCaution () |
This function is called when in caution mode. | |
void | distanceDanger () |
This function is called when in danger mode. | |
void | buttonPressed () |
This function is called when button is pressed. | |
Variables | |
int | distance |
int | buttonFlag = 0 |
int | displayReading = 0 |
Detailed Description
Header file containing functions prototypes, defines and global variables.
The software of Vehicle Rear Assistant. ELEC 2645
- Date:
- APRIL 2015
Definition in file main.h.
Function Documentation
void buttonPressed | ( | ) |
void distanceCaution | ( | ) |
void distanceDanger | ( | ) |
void distanceSafe | ( | ) |
void getDistance | ( | ) |
void readDistance | ( | ) |
Print "CAR" and a block on LCD according to distance measured.
- Parameters:
-
lcd.drawRect - draw rectangle to represent object lcd.printString - draw "CAR" to represent car lcd.refresh() - refresh LCD display distanceSafe() - GREEN LED and buzzer is activated in safe mode distanceCaution() - YELLOW LED and buzzer is activated in caution mode distanceDanger() - RED LED and buzzer is activated in danger mode
void welcomeText | ( | ) |
Variable Documentation
int buttonFlag = 0 |
int displayReading = 0 |
Generated on Sun Jul 31 2022 21:34:31 by 1.7.2