scooter / Mbed 2 deprecated Scooter-uC-Programm

Dependencies:   mbed

Revision:
8:fb6cb712eb52
Parent:
7:ed9a83df000a
Child:
9:b1bf6699d610
--- a/Messdatenerfassung.cpp	Tue May 19 15:49:46 2015 +0000
+++ b/Messdatenerfassung.cpp	Tue May 26 12:14:44 2015 +0000
@@ -3,7 +3,7 @@
 AnalogIn voltage0(A0); // Edit Pin-Port for the accu-voltage measurement
 AnalogIn voltage1(A1); // Edit Pin-Port for the throttle-voltage measurement
 AnalogIn voltage2(A2); // Edit Pin-Port for the capacitor-voltage measurement
-
+DigitalIn breaksensor(PA_5); //Edit Pin-Port for the breaksensor measurement!
 float Accu_Voltage(){
     
     float meas0;            
@@ -13,7 +13,7 @@
     
 float hall_umrechnung(){
     float meas0;
-    meas0 = voltage1read() - 0.27; // read adc and rearange the voltage_value,because its 0.27 when the throttle is off
+    meas0 = voltage1.read() - 0.27; // read adc and rearange the voltage_value,because its 0.27 when the throttle is off
     
     if(meas0 < 0){          // meas0 isnt allowed to be <0 because its sets the pulsewidht of the pwm
         meas0 = 0;
@@ -31,6 +31,12 @@
 float Capacitor_Voltage(){
     
     float meas0;
-    meas0 = avoltage2.read(); //read adc value
+    meas0 = voltage2.read(); //read adc value
     return meas0; // return value
     }
+int break_value(){
+    int break_value;  
+    break_value = breaksensor.read(); // read breaksensor value(1/0)
+    return break_value; // return value
+    
+    }
\ No newline at end of file