![](/media/cache/profiles/sirooni.jpg.50x50_q85.jpg)
my qei test
main.cpp
- Committer:
- highfieldsnj
- Date:
- 2021-10-18
- Revision:
- 0:fb962a369fdf
- Child:
- 1:5c265e848abb
File content as of revision 0:fb962a369fdf:
#include "QEI.h" Serial pc(USBTX, USBRX,115200); //DigitalIn b(USER_BUTTON); //Use X4 encoding. QEI wheel[] = { QEI(PB_7,PB_6,NC,100,QEI::X4_ENCODING), //QEI(PA_6,PA_7,NC,100,QEI::X4_ENCODING), だめ QEI(PA_9,PA_8,NC,100,QEI::X4_ENCODING), QEI(PA_1,PA_0,NC,100,QEI::X4_ENCODING) }; int main() { //b.mode(PullUp); while(1){ /*if(b.read() == 0){ for(int i=0; i<1; i++){ wheel[i].reset(); } }*/ for(int i=0; i<3; i++){ pc.printf("%d=%d ", i, wheel[i].getPulses()); } pc.printf("\r\n"); } }