Aaron Berk
/
QEI_HelloWorld
Quadrature encoder interface example.
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "QEI.h" 00002 00003 Serial pc(USBTX, USBRX); 00004 //Use X4 encoding. 00005 //QEI wheel(p29, p30, NC, 624, QEI::X4_ENCODING); 00006 //Use X2 encoding by default. 00007 QEI wheel (p29, p30, NC, 624); 00008 00009 int main() { 00010 00011 while(1){ 00012 wait(0.1); 00013 pc.printf("Pulses is: %i\n", wheel.getPulses()); 00014 } 00015 00016 }
Generated on Tue Jul 12 2022 11:38:08 by 1.7.2