encoder test for the biorobotics shield

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 DigitalIn encoder_1a(D7);
00004 DigitalIn encoder_1b(D6);
00005 
00006 Serial pc(USBTX, USBRX);
00007 
00008 int main()
00009 {
00010     while (true) {
00011         pc.baud(115200);
00012         
00013         pc.printf("encoder a: %d\r\n", encoder_1a.read());
00014         pc.printf("encoder b: %d\r\n\n", encoder_1b.read());
00015         
00016         wait(1.0f);
00017     }
00018 }