![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
This is car control simulation by using Mbed controller and real time operating system.
Dependencies: MCP23017 Servo WattBob_TextLCD mbed-rtos mbed
Fork of Ass3 by
main.cpp@8:6e55db96c11c, 2014-04-09 (annotated)
- Committer:
- muaiyd
- Date:
- Wed Apr 09 09:41:30 2014 +0000
- Revision:
- 8:6e55db96c11c
- Parent:
- 7:a92da438d06c
- Child:
- 9:d86a6b8cdfa4
Finished all the tasks except the saving in file
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
muaiyd | 8:6e55db96c11c | 1 | /* |
muaiyd | 8:6e55db96c11c | 2 | Small software to simulate a car |
muaiyd | 8:6e55db96c11c | 3 | */ |
muaiyd | 0:68ce46607848 | 4 | #include "CAR.h" |
muaiyd | 1:b409ad65466a | 5 | |
muaiyd | 0:68ce46607848 | 6 | int main() { |
muaiyd | 0:68ce46607848 | 7 | Port.write_bit(1,BL_BIT); |
muaiyd | 0:68ce46607848 | 8 | CAR CAR1; |
muaiyd | 1:b409ad65466a | 9 | Thread Accelero_Brake_Thread(CAR1.Accelero_Brake_Read); |
muaiyd | 1:b409ad65466a | 10 | Thread Average_Speed_Measure_Thread(CAR1.Average_Speed_Measure); |
muaiyd | 1:b409ad65466a | 11 | Thread Average_Speed_Show_Thread(CAR1.Average_Speed_Show); |
muaiyd | 1:b409ad65466a | 12 | Thread OverSpeed_Thread(CAR1.OverSpeed); |
muaiyd | 7:a92da438d06c | 13 | Thread Odo_Show_Indicator_Switch_Read_Thread(CAR1.Odo_Show_Indicator_Switch_Read); |
muaiyd | 1:b409ad65466a | 14 | Thread SEND_CAR_VALUES_Thread(CAR1.SEND_CAR_VALUES); |
muaiyd | 1:b409ad65466a | 15 | Thread DUMP_CAR_VALUES_Thread(CAR1.DUMP_CAR_VALUES_En); |
muaiyd | 7:a92da438d06c | 16 | Thread Side_Light_Flash_Thread(CAR1.Side_Light_Flash); |
muaiyd | 8:6e55db96c11c | 17 | Thread Side_Light_Thread(CAR1.Side_Light); |
muaiyd | 1:b409ad65466a | 18 | while(1){ |
muaiyd | 1:b409ad65466a | 19 | if(IsOverSpeed){ |
muaiyd | 1:b409ad65466a | 20 | OverSpeedLED = 0x6; |
muaiyd | 1:b409ad65466a | 21 | wait(0.2); |
muaiyd | 1:b409ad65466a | 22 | OverSpeedLED = 0x9; |
muaiyd | 1:b409ad65466a | 23 | wait(0.2) ; |
muaiyd | 1:b409ad65466a | 24 | } |
muaiyd | 1:b409ad65466a | 25 | else{ |
muaiyd | 1:b409ad65466a | 26 | OverSpeedLED = 0; |
muaiyd | 1:b409ad65466a | 27 | } |
muaiyd | 0:68ce46607848 | 28 | } |
muaiyd | 0:68ce46607848 | 29 | } |