![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
ExternalEncoder
Dependencies: mbed-os
Diff: main.cpp
- Revision:
- 0:d9d4bbd5c09f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Mar 18 15:16:40 2019 +0000 @@ -0,0 +1,15 @@ +#include "mbed.h" +#include "encoderKRAI.h" + +encoderKRAI encoder(PC_3, PC_2, 1000, encoderKRAI::X4_ENCODING); +Serial pc(USBTX, USBRX, 115200); + +int main(){ + //Static untuk tidak kereset + static int nilai=0; + while(1){ + nilai = encoder.getPulses(); + pc.printf("encoder= %d\n", nilai); + wait_ms(100); + } +} \ No newline at end of file