chad

Dependencies:   MCP23017 WattBob_TextLCD mbed-rtos mbed

Revision:
19:1fecb6fa14a2
Parent:
18:bda795e28ed7
Child:
20:aeb7b7044c31
--- a/main.cpp	Mon Mar 13 20:50:18 2017 +0000
+++ b/main.cpp	Tue Apr 04 13:47:53 2017 +0000
@@ -0,0 +1,55 @@
+// Paramater Allocation
+// 
+
+#include "main.h"
+
+// Pointers to LCD Screen
+MCP23017            *par_port;  // pointer to 16-bit parallel I/O chip
+WattBob_TextLCD     *lcd;       // pointer to 2*16 character LCD object
+
+// Serial Connection
+
+Serial pc(USBTX, USBRX,115200);
+
+// Analogue Input
+AnalogIn Accel(p15);            // Accelerator Pedal Input
+AnalogIn Brake(p16);            // Brake Pedal Input
+
+// Digital Input
+DigitalIn Ignit(p11);           // Engine On/Off
+DigitalIn SideL(p12);           // Side Light On/Off
+DigitalIn Indi_L(p13);          // Left indicator switch
+DigitalIn Indi_R(p14);          // Right idicator switch
+
+// Analogue Output
+Servo SpeedIndicator(p21);          // Speed Indicator Servo
+
+// Digital Output
+DigitalOut Ignit_LED(LED1);     // Ignition LED Indicator
+DigitalOut SideL_LED(LED2);     // Side Light Indicator
+DigitalOut Indi_L_LED(LED3);    // Left Indicator LED
+DigitalOut Indi_R_LED(LED4);    // Right Indicator LED
+
+DigitalOut O_S_LED(p18);        // Overspeed LED (REDBOX)
+
+/*typedef struct {
+    float   speed;
+    float   accelerator;
+    float   brake;
+} mail_t;
+
+Mail<mail_t, 100> mail_box;*/
+
+ 
+float Accel_Reg;
+float Brake_Reg;
+
+float p;
+
+float Avg_Speed;
+float Speed_In;
+float Speed_0;
+float Speed_1;
+float Speed_2;
+
+float dist;