Inverted Pendulum / Mbed 2 deprecated IP-Interface

Dependencies:   mbed QEI

MagneticEncoder/MagneticEnc.cpp

Committer:
rkolli
Date:
2016-11-28
Revision:
24:8a62311f2c5e
Parent:
7:1ff48d6da827

File content as of revision 24:8a62311f2c5e:

#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();
 }