Encoder program for K64F microcontroller with 64 bit confic
Dependencies: MODSERIAL QEI mbed
Fork of Encoder_program by
main.cpp
- Committer:
- Wallie117
- Date:
- 2015-09-23
- Revision:
- 0:9b63614c20f3
- Child:
- 1:b9fb9ec8a9e6
File content as of revision 0:9b63614c20f3:
#include "mbed.h" #include "QEI.h" #include "MODSERIAL.h" Serial pc(USBTX, USBRX); DigitalOut motor2direction(D4); //D4 en D5 zijn motor 2 (op het motorshield) PwmOut motor2speed(D5); //Use X4 encoding. //QEI wheel(p29, p30, NC, 624, QEI::X4_ENCODING); //Use X2 encoding by default. QEI wheel (D11, D12, NC, 64,QEI::X4_ENCODING); // int main() { while(1){ motor2direction.write(1); motor2speed.write(0.2); wait(0.1); pc.printf("Pulses is: %i\n", (wheel.getPulses()/(64*131))); } }