The encoder DRS exercise
Dependencies: MODSERIAL QEI mbed
Revision 0:9aa5fb3f9174, committed 2015-09-23
- Comitter:
- Technical_Muffin
- Date:
- Wed Sep 23 13:14:09 2015 +0000
- Commit message:
- First commit of the encoder exercise
Changed in this revision
diff -r 000000000000 -r 9aa5fb3f9174 MODSERIAL.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MODSERIAL.lib Wed Sep 23 13:14:09 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/Sissors/code/MODSERIAL/#6ffa97119f4f
diff -r 000000000000 -r 9aa5fb3f9174 QEI.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/QEI.lib Wed Sep 23 13:14:09 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/aberk/code/QEI/#5c2ad81551aa
diff -r 000000000000 -r 9aa5fb3f9174 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Sep 23 13:14:09 2015 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" +#include "QEI.h" +#include "MODSERIAL.h" + +DigitalOut gpo(D0); +DigitalOut led(LED_RED); + +QEI motor1(D13,D12,NC, 624); +MODSERIAL pc(USBTX,USBRX); + +int main() +{ + pc.baud(115200); + + while(1) { + wait(0.2); + pc.printf("the amount of pulses is: %d\r\n",motor1.getPulses()); + // the amount of counts for one revolution is 32 + //this is X2 encodng, as the QEI usus X2 by default + //and the motor encoder has a X4 encoder and thus 64 counts per revolution + // X unit counts equals one magnet shaft rotation, with X being 64 + //thus keeping in mind the gearbox the amount of counts for a gearbox revolution is 8400 + } + } \ No newline at end of file
diff -r 000000000000 -r 9aa5fb3f9174 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Sep 23 13:14:09 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/4f6c30876dfa \ No newline at end of file