Gustav Aditya Permana
/
coba_QEI
hanya buat kamu B
main.cpp
- Committer:
- gustavaditya
- Date:
- 2016-11-05
- Revision:
- 0:bb49b8e23b5d
- Child:
- 1:d4e4fc0ee666
File content as of revision 0:bb49b8e23b5d:
#include "mbed.h" #include "QEI.h" QEI encoder( PA_3, PA_2, NC, 360, QEI::X4_ENCODING); Serial pc(USBTX,USBRX); int pulse; int rev; int main() { pc.baud(115200); while(1) { pulse = encoder.getPulses(); rev = encoder.getRevolutions(); pc.printf("%d Pulses\t\t%d Putaran\n", pulse, rev); } }