Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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();
}