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.
Dependencies: FastPWM mbed QEI biquadFilter HIDScope MODSERIAL
main.cpp
- Committer:
- efvanmarrewijk
- Date:
- 2018-10-19
- Revision:
- 17:0ae9e8c958f8
- Parent:
- 16:720365110953
- Child:
- 18:ca084c362855
File content as of revision 17:0ae9e8c958f8:
// Inclusion of libraries #include "mbed.h" #include "FastPWM.h" #include "QEI.h" // Includes library for encoder #include "MODSERIAL.h" #include "HIDScope.h" #include "BiQuad.h" // Input // Output // Utilisation of libraries MODSERIAL pc(USBTX, USBRX); QEI Encoder1(D10,D11,NC,4200); // Counterclockwise motor rotation is the positive direction QEI Encoder2(D8,D9,NC,4200); // Counterclockwise motor rotation is the positive direction // Global variables // Functions // Main program int main() { pc.baud(115200); while (true) { int counts1 = Encoder1.getPulses(); int counts2 = Encoder2.getPulses(); pc.printf("Counts1: %i Counts2: %i\r\n",counts1,counts2); } }