Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 0:a2a55f1ea6be, committed 2015-09-23
- Comitter:
- yohoo15
- Date:
- Wed Sep 23 14:35:14 2015 +0000
- Commit message:
- Count the encoder signal
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/QEI.lib Wed Sep 23 14:35:14 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/aberk/code/QEI/#5c2ad81551aa
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Wed Sep 23 14:35:14 2015 +0000
@@ -0,0 +1,25 @@
+#include "mbed.h"
+#include "QEI.h"
+
+Serial pc(USBTX, USBRX);
+//Use X4 encoding.
+//QEI wheel(p29, p30, NC, 624, QEI::X4_ENCODING);
+//Use X2 encoding by default.
+QEI wheel (PTC10, PTC11, NC, 624);
+
+// Define pin for motor control
+DigitalOut directionPin(D4);
+DigitalOut PWM(D5);
+
+int main() {
+
+
+ directionPin.write(1);
+ PWM.write(1);
+
+ while(1){
+ wait(0.1);
+ pc.printf("Pulses is: %i\n", wheel.getPulses());
+ }
+
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Sep 23 14:35:14 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/4f6c30876dfa \ No newline at end of file