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@24:8a62311f2c5e, 2016-11-28 (annotated)
- Committer:
- rkolli
- Date:
- Mon Nov 28 02:49:16 2016 +0000
- Revision:
- 24:8a62311f2c5e
- Parent:
- 7:1ff48d6da827
commenting
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
enderceylan | 7:1ff48d6da827 | 1 | #include "MagneticEnc.h" |
enderceylan | 7:1ff48d6da827 | 2 | #include "mbed.h" |
enderceylan | 2:67cf01beacc1 | 3 | |
enderceylan | 2:67cf01beacc1 | 4 | |
enderceylan | 7:1ff48d6da827 | 5 | MagneticEnc::MagneticEnc(PinName _PWMOUT, int _period, int _pulsewidth) : |
enderceylan | 7:1ff48d6da827 | 6 | mypwm(_PWMOUT), period(_period), pulsewidth(_pulsewidth) { |
enderceylan | 7:1ff48d6da827 | 7 | mypwm.period_ms(period); //10 |
enderceylan | 7:1ff48d6da827 | 8 | mypwm.pulsewidth_ms(pulsewidth); //1 |
enderceylan | 2:67cf01beacc1 | 9 | |
enderceylan | 2:67cf01beacc1 | 10 | } |
enderceylan | 2:67cf01beacc1 | 11 | |
enderceylan | 7:1ff48d6da827 | 12 | float MagneticEnc::readEnc() { |
enderceylan | 7:1ff48d6da827 | 13 | return mypwm.read(); |
enderceylan | 7:1ff48d6da827 | 14 | } |
enderceylan | 2:67cf01beacc1 | 15 |