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 Muaiyd Al-Zandi

Revision:
9:d86a6b8cdfa4
Parent:
8:6e55db96c11c
Child:
10:2522e3878e1c
--- a/main.cpp	Wed Apr 09 09:41:30 2014 +0000
+++ b/main.cpp	Wed Apr 09 11:05:32 2014 +0000
@@ -1,20 +1,24 @@
 /*
-Small software to simulate a car 
+Small software to simulate a car and show the Average speed and the odometer
+on the LCD. Also, it saves the average speed and accelerometer and brake value
+in a special queue. This queue is sumped into a file every 20 second.
+Author : Muaiyd Hameed Al-Zandi
+Date   : 09/04/2014 
 */
 #include "CAR.h"
 
 int main() {
+    //Turn the LCD on and initialize
     Port.write_bit(1,BL_BIT);
-    CAR CAR1;
-    Thread Accelero_Brake_Thread(CAR1.Accelero_Brake_Read);
-    Thread Average_Speed_Measure_Thread(CAR1.Average_Speed_Measure);
-    Thread Average_Speed_Show_Thread(CAR1.Average_Speed_Show);
-    Thread OverSpeed_Thread(CAR1.OverSpeed);
-    Thread Odo_Show_Indicator_Switch_Read_Thread(CAR1.Odo_Show_Indicator_Switch_Read);
-    Thread SEND_CAR_VALUES_Thread(CAR1.SEND_CAR_VALUES);
-    Thread DUMP_CAR_VALUES_Thread(CAR1.DUMP_CAR_VALUES_En);
-    Thread Side_Light_Flash_Thread(CAR1.Side_Light_Flash);
-    Thread Side_Light_Thread(CAR1.Side_Light);
+    Thread Accelero_Brake_Thread(CAR::Accelero_Brake_Read);
+    Thread Average_Speed_Measure_Thread(CAR::Average_Speed_Measure);
+    Thread Average_Speed_Show_Thread(CAR::Average_Speed_Show);
+    Thread OverSpeed_Thread(CAR::OverSpeed);
+    Thread Odo_Show_Indicator_Switch_Read_Thread(CAR::Odo_Show_Indicator_Switch_Read);
+    Thread SEND_CAR_VALUES_Thread(CAR::SEND_CAR_VALUES);
+    Thread DUMP_CAR_VALUES_Thread(CAR::DUMP_CAR_VALUES_En);
+    Thread Side_Light_Flash_Thread(CAR::Side_Light_Flash);
+    Thread Side_Light_Thread(CAR::Side_Light);
     while(1){
         if(IsOverSpeed){
             OverSpeedLED = 0x6;