Mauricio Peña / Mbed 2 deprecated Encoder

Dependencies:   QEI TextLCD mbed

Fork of Encoder1 by Federico Velasquez V

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 
00002 #include "QEI.h"
00003 #include "TextLCD.h"
00004 
00005 TextLCD lcd(PTC10, PTC11, PTC12, PTC13, PTC16, PTC17); // rs, e, d4-d7TextLCD lcd(PTC10, PTC11, PTC12, PTC13, PTC16, PTC17); // rs, e, d4-d7
00006 QEI leftQei(PTD6, PTD7, NC, 624);
00007  
00008 int main() {
00009         lcd.locate(0,0);
00010         lcd.printf("pulsos: ");
00011         
00012     while(1){
00013         lcd.locate(8,0);
00014         lcd.printf("     ");
00015         
00016         lcd.locate(8,0);
00017         lcd.printf("%i",leftQei.getPulses());
00018         wait(0.2);         
00019         
00020     }
00021  
00022 }
00023     
00024