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

Committer:
muaiyd
Date:
Tue May 06 09:11:01 2014 +0000
Revision:
11:7f2414ecb7ee
Parent:
7:a92da438d06c
Child:
13:e5b22bfbe67b
Last change; Optemization

Who changed what in which revision?

UserRevisionLine numberNew contents of line
muaiyd 0:68ce46607848 1 #ifndef COMMON_VARIABLE_H
muaiyd 0:68ce46607848 2 #define COMMON_VARIABLE_H
muaiyd 0:68ce46607848 3 #include "MCP23017.h"
muaiyd 0:68ce46607848 4 #include "WattBob_TextLCD.h"
muaiyd 0:68ce46607848 5 #include "mbed.h"
muaiyd 1:b409ad65466a 6 #include "Servo.h"
muaiyd 0:68ce46607848 7
muaiyd 11:7f2414ecb7ee 8 static Servo SpeedShow_Servo(p21); // Use pin 21 to control the servo
muaiyd 0:68ce46607848 9 static MCP23017 Port(p9,p10,0x40) ; // 16-bit object with I2C Chip MCP23017
muaiyd 0:68ce46607848 10 static WattBob_TextLCD LCD(&Port); // A 2*16 chacater LCD object
muaiyd 1:b409ad65466a 11 static BusOut OverSpeedLED(LED1 , LED2 , LED3 , LED4);
muaiyd 1:b409ad65466a 12 static DigitalIn EngineSwitch(p5);
muaiyd 7:a92da438d06c 13 static DigitalOut R_Side_Light(p27);
muaiyd 7:a92da438d06c 14 static DigitalOut L_Side_Light(p28);
muaiyd 7:a92da438d06c 15 static DigitalOut R_Side_Indicator(p29);
muaiyd 7:a92da438d06c 16 static DigitalOut L_Side_Indicator(p30);
muaiyd 7:a92da438d06c 17 static DigitalIn LSide_Light_Switch(p6);
muaiyd 7:a92da438d06c 18 static DigitalIn RSide_Light_Switch(p7);
muaiyd 7:a92da438d06c 19 static DigitalIn LSide_Indicator_Switch(p15);
muaiyd 7:a92da438d06c 20 static DigitalIn RSide_Indicator_Switch(p16);
muaiyd 1:b409ad65466a 21 static AnalogIn Accelerometer(p19);
muaiyd 1:b409ad65466a 22 static AnalogIn Brake(p20);
muaiyd 0:68ce46607848 23
muaiyd 1:b409ad65466a 24 extern const uint8_t MaxSpeed;
muaiyd 1:b409ad65466a 25
muaiyd 1:b409ad65466a 26 extern bool EngineStat;
muaiyd 1:b409ad65466a 27 extern bool IsOverSpeed;
muaiyd 1:b409ad65466a 28 extern float Accelerometer_Value;
muaiyd 1:b409ad65466a 29 extern float Brake_Value;
muaiyd 1:b409ad65466a 30 extern uint8_t Speed[3];
muaiyd 1:b409ad65466a 31 extern uint8_t Average_Speed;
muaiyd 1:b409ad65466a 32 extern float Odometer_Value;
muaiyd 1:b409ad65466a 33 extern uint8_t Counter;
muaiyd 1:b409ad65466a 34
muaiyd 0:68ce46607848 35
muaiyd 0:68ce46607848 36 #endif