![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
qei
main.cpp@0:bbe5f6306f45, 2020-07-01 (annotated)
- Committer:
- 20172573063
- Date:
- Wed Jul 01 00:57:09 2020 +0000
- Revision:
- 0:bbe5f6306f45
qei
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
20172573063 | 0:bbe5f6306f45 | 1 | #include "mbed.h" |
20172573063 | 0:bbe5f6306f45 | 2 | #include "QEI.h" |
20172573063 | 0:bbe5f6306f45 | 3 | |
20172573063 | 0:bbe5f6306f45 | 4 | Serial pc(USBTX, USBRX); |
20172573063 | 0:bbe5f6306f45 | 5 | |
20172573063 | 0:bbe5f6306f45 | 6 | DigitalOut gpo(D0); |
20172573063 | 0:bbe5f6306f45 | 7 | DigitalOut led(LED_RED); |
20172573063 | 0:bbe5f6306f45 | 8 | QEI wheel (A0, PTD5, NC, 624); |
20172573063 | 0:bbe5f6306f45 | 9 | |
20172573063 | 0:bbe5f6306f45 | 10 | int main() |
20172573063 | 0:bbe5f6306f45 | 11 | { |
20172573063 | 0:bbe5f6306f45 | 12 | while(1){ |
20172573063 | 0:bbe5f6306f45 | 13 | wait(0.1); |
20172573063 | 0:bbe5f6306f45 | 14 | pc.printf("Pulses is: %i\n", wheel.getPulses()); |
20172573063 | 0:bbe5f6306f45 | 15 | } |
20172573063 | 0:bbe5f6306f45 | 16 | |
20172573063 | 0:bbe5f6306f45 | 17 | } |