Inverted Pendulum / Mbed 2 deprecated IP-Interface

Dependencies:   mbed QEI

Revision:
7:1ff48d6da827
Parent:
5:74fcd196ff96
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MagneticEncoder/MagneticEnc.cpp	Fri Nov 11 18:51:52 2016 +0000
@@ -0,0 +1,15 @@
+#include "MagneticEnc.h"
+#include "mbed.h"
+
+
+MagneticEnc::MagneticEnc(PinName _PWMOUT, int _period, int _pulsewidth) : 
+    mypwm(_PWMOUT), period(_period), pulsewidth(_pulsewidth) {
+    mypwm.period_ms(period); //10
+    mypwm.pulsewidth_ms(pulsewidth); //1
+  
+}
+
+float MagneticEnc::readEnc() {
+    return mypwm.read();
+ }
+