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.
main.cpp
00001 #include "QEI.h" 00002 00003 Serial pc(USBTX, USBRX); 00004 00005 #define ROTATE_PER_REVOLUTIONS 500 00006 //Use X4 encoding. 00007 QEI wheel(dp17, dp18, dp26, ROTATE_PER_REVOLUTIONS, QEI::X4_ENCODING); 00008 //Use X2 encoding by default. 00009 //QEI wheel (p30, p29, NC, 624); 00010 00011 int main() { 00012 while(1){ 00013 wait(0.1); 00014 //pc.printf("Pulses: %07d\n", wheel.getPulses()); 00015 pc.printf("Rotate: %04.3f\r\n", (double)wheel.getPulses()/(ROTATE_PER_REVOLUTIONS*4)); 00016 } 00017 }
Generated on Wed Jul 20 2022 19:22:17 by
1.7.2