Cube Mini Solution

Dependencies:   mbed QEI MPU6050 BLE_API nRF51822 MCP4725 eMPL_MPU6050

Revision:
14:fe003a27018d
Parent:
13:41edfb8e3b3c
Child:
15:3395ad948f44
--- a/main.cpp	Thu May 28 18:14:34 2020 +0000
+++ b/main.cpp	Fri May 29 11:31:02 2020 +0000
@@ -22,6 +22,8 @@
             MPU6050_SCL p13
         Velocity Input as Analogue Signal from Escon
             Pin 5
+        Button Pin
+            Pin 6
         Current output to Escon occurs through I2C connection to a DAC (Digital to Analogue Converter). DAC outputs Analogue voltage to Escon
             Pin SDA p3
             Pin SCL P4
@@ -64,6 +66,7 @@
 // -------------------------------
 AnalogIn Velocity_Voltage_Input(p5); // Velocity Input as Analogue Signal from Escon
 DigitalOut Pin_3V3(p30);             // Defining P30 as 3V3 Pin for internal use. Please do not modify.
+InterruptIn Button(p6);        // User Button Interrput
 
 // -------------------------------
 // Initialization of Values and Variables
@@ -156,7 +159,7 @@
 // Linear Scaler - Follow the mapping mentioned in the Notes above
 
 //******************************************************************************
-//---------- Main Loop -------------
+//----------------------------- Main Loop --------------------------------------
 //******************************************************************************
 int main()
 {
@@ -181,7 +184,7 @@
 
 }
 //******************************************************************************
-//---------- Control Loop (called via interrupt) -------------
+//------------------ Control Loop (called via interrupt) -----------------------
 //******************************************************************************
 void updateControllers(void)
 {
@@ -209,10 +212,11 @@
 
     
 
-
     // ------------------------- Controller -----------------------------
 
-    // ......
+    // Switch Statement Maybe?......
+    
+    // ----------------
 
     // Print Data
     if(++k >= 100) {
@@ -222,4 +226,8 @@
 
 
 }
+//******************************************************************************
+//------------------ User functions like buttens handle etc. -------------------
+//******************************************************************************
 
+//...