scooter / Mbed 2 deprecated Scooter-uC-Programm

Dependencies:   mbed

Revision:
11:7dfdb8074992
Parent:
9:b1bf6699d610
Child:
12:bad33209d1bb
--- a/Motorsteuerung.cpp	Tue May 26 15:30:59 2015 +0000
+++ b/Motorsteuerung.cpp	Tue Jun 09 11:17:32 2015 +0000
@@ -3,13 +3,17 @@
 
 
 PwmOut mypwm(PWM_OUT);      //For output PWM-pin
-AnalogIn analog_value0(A0); //For reading Hall-Sensor ADC-PIN 
+AnalogIn analog_value0(A0); //For reading Hall-Sensor ADC-PIN
+
+void motoransteuerung()
+{
+
+    mypwm.period_us(PERIODEN_DAUER); //
 
-void motoransteuerung(){
-  
-  mypwm.period_us(PERIODEN_DAUER); //
-  
     while(1) {
-        mypwm.pulsewidth_us(PERIODEN_DAUER*hall_umrechnung()); //How often to change between High and low per Period.
+        if(break_value==0) {
+            mypwm.pulsewidth_us(PERIODEN_DAUER*hall_umrechnung()); //How often to change between High and low per Period.
+        }
     }
+}
 }
\ No newline at end of file