![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
nRF24L01, encoder, pca9685, pid
Dependencies: mbed QEI-1 nRF24L01P xiugai
main.cpp
- Committer:
- glintligo
- Date:
- 2018-04-30
- Revision:
- 0:e63858fec119
- Child:
- 1:1e3eb2d1496b
File content as of revision 0:e63858fec119:
#include "mbed.h" #include "QEI.h" Serial pc(PA_2, PA_3); PwmOut mypwm1(PB_7); PwmOut mypwm2(PB_6); QEI wheel(PB_10, PB_11, NC, 11, QEI::X4_ENCODING); int x; int main() { mypwm1.period_ms(2); mypwm2.period_ms(2); mypwm1.pulsewidth(0.001); mypwm2.pulsewidth(0.001); while(1) { wait(0.1); x = wheel.getPulses(); pc.printf("Pulses is: %i\n", x); } }