Example of usage of encoder library
Dependencies: Encoder MODSERIAL mbed
Revision 0:836046040450, committed 2013-09-26
- Comitter:
- vsluiter
- Date:
- Thu Sep 26 14:12:19 2013 +0000
- Child:
- 1:8d99355e740b
- Commit message:
- Simple example of usage of Encoder library.
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Encoder.lib Thu Sep 26 14:12:19 2013 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/vsluiter/code/Encoder/#c90b36abcbf8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MODSERIAL.lib Thu Sep 26 14:12:19 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/Sissors/code/MODSERIAL/#9a41078f0488
--- /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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Sep 26 14:12:19 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f \ No newline at end of file