![](/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@1:b409ad65466a, 2014-04-07 (annotated)
- Committer:
- muaiyd
- Date:
- Mon Apr 07 15:19:37 2014 +0000
- Revision:
- 1:b409ad65466a
- Parent:
- 0:68ce46607848
- Child:
- 7:a92da438d06c
Finish the semefor with mail
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
muaiyd | 0:68ce46607848 | 1 | #include "CAR.h" |
muaiyd | 1:b409ad65466a | 2 | |
muaiyd | 0:68ce46607848 | 3 | int main() { |
muaiyd | 0:68ce46607848 | 4 | Port.write_bit(1,BL_BIT); |
muaiyd | 0:68ce46607848 | 5 | CAR CAR1; |
muaiyd | 1:b409ad65466a | 6 | Thread Accelero_Brake_Thread(CAR1.Accelero_Brake_Read); |
muaiyd | 1:b409ad65466a | 7 | Thread Average_Speed_Measure_Thread(CAR1.Average_Speed_Measure); |
muaiyd | 1:b409ad65466a | 8 | Thread Average_Speed_Show_Thread(CAR1.Average_Speed_Show); |
muaiyd | 1:b409ad65466a | 9 | Thread OverSpeed_Thread(CAR1.OverSpeed); |
muaiyd | 1:b409ad65466a | 10 | Thread Odometer_Measure_Thread(CAR1.Odometer_Measure); |
muaiyd | 1:b409ad65466a | 11 | Thread Odometer_Show_Thread(CAR1.Odometer_Show); |
muaiyd | 1:b409ad65466a | 12 | Thread SEND_CAR_VALUES_Thread(CAR1.SEND_CAR_VALUES); |
muaiyd | 1:b409ad65466a | 13 | Thread DUMP_CAR_VALUES_Thread(CAR1.DUMP_CAR_VALUES_En); |
muaiyd | 1:b409ad65466a | 14 | while(1){ |
muaiyd | 1:b409ad65466a | 15 | if(IsOverSpeed){ |
muaiyd | 1:b409ad65466a | 16 | OverSpeedLED = 0x6; |
muaiyd | 1:b409ad65466a | 17 | wait(0.2); |
muaiyd | 1:b409ad65466a | 18 | OverSpeedLED = 0x9; |
muaiyd | 1:b409ad65466a | 19 | wait(0.2) ; |
muaiyd | 1:b409ad65466a | 20 | } |
muaiyd | 1:b409ad65466a | 21 | else{ |
muaiyd | 1:b409ad65466a | 22 | OverSpeedLED = 0; |
muaiyd | 1:b409ad65466a | 23 | } |
muaiyd | 0:68ce46607848 | 24 | } |
muaiyd | 0:68ce46607848 | 25 | } |