scooter / Mbed 2 deprecated Scooter-uC-Programm

Dependencies:   mbed

Revision:
6:7c0a32831a4f
Child:
8:fb6cb712eb52
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Motorsteuerung.cpp	Tue May 19 15:14:50 2015 +0000
@@ -0,0 +1,17 @@
+#include "mbed.h"
+#include "messdatenerfassung.h"
+
+#define PERIODEN_DAUER 10000
+
+
+PwmOut mypwm(PWM_OUT);      //For output PWM-pin
+AnalogIn analog_value0(A0); //For reading Hall-Sensor ADC-PIN 
+
+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.
+    }
+}
\ No newline at end of file