Jan Boerman
/
EncoderTest
encoder test for the biorobotics shield
Revision 0:5484c87bf9f8, committed 2016-09-26
- Comitter:
- Jankoekenpan
- Date:
- Mon Sep 26 09:21:17 2016 +0000
- Commit message:
- initial encoder test
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 5484c87bf9f8 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Sep 26 09:21:17 2016 +0000 @@ -0,0 +1,18 @@ +#include "mbed.h" + +DigitalIn encoder_1a(D7); +DigitalIn encoder_1b(D6); + +Serial pc(USBTX, USBRX); + +int main() +{ + while (true) { + pc.baud(115200); + + pc.printf("encoder a: %d\r\n", encoder_1a.read()); + pc.printf("encoder b: %d\r\n\n", encoder_1b.read()); + + wait(1.0f); + } +} \ No newline at end of file
diff -r 000000000000 -r 5484c87bf9f8 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Sep 26 09:21:17 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/abea610beb85 \ No newline at end of file