Example of usage of encoder library
Dependencies: Encoder MODSERIAL mbed
Diff: main.cpp
- Revision:
- 0:836046040450
- Child:
- 1:8d99355e740b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Sep 26 14:12:19 2013 +0000 @@ -0,0 +1,14 @@ +#include "mbed.h" +#include "encoder.h" +#include "MODSERIAL.h" + + +int main() { + Encoder motor1(PTD0,PTC9); + MODSERIAL pc(USBTX,USBRX); + pc.baud(115200); + while(1) { + wait(0.2); + pc.printf("pos: %d, speed %f \r\n",motor1.getPosition(), motor1.getSpeed()); + } +} \ No newline at end of file