test with PID control to screen on your computer

Dependencies:   Motor_with_encoder MODSERIAL QEI mbed

Fork of Project_motor by Biorobotics Project

Files at this revision

API Documentation at this revision

Comitter:
EvB
Date:
Wed Oct 11 06:57:28 2017 +0000
Parent:
6:b89ca8add6ee
Commit message:
Changed state of speed calculation of encoder to 'true'

Changed in this revision

QEI.lib Show annotated file Show diff for this revision Revisions of this file
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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QEI.lib	Wed Oct 11 06:57:28 2017 +0000
@@ -0,0 +1,1 @@
+http://os.mbed.com/users/aberk/code/QEI/#5c2ad81551aa
--- a/main.cpp	Mon Oct 09 15:05:54 2017 +0000
+++ b/main.cpp	Wed Oct 11 06:57:28 2017 +0000
@@ -1,6 +1,7 @@
 #include "mbed.h"
 #include "MODSERIAL.h"
 #include "encoder.h"
+#include "QEI.h"
 // this program can turn the motor clockwise or counterclockwise depending on the value p or n typed into the terminal. with 's' you can stop the motor
 
 MODSERIAL pc(USBTX,USBRX);
@@ -13,8 +14,8 @@
 DigitalIn button2(D12);
 Ticker potmeterreadout;
 Ticker encoderreadout;
-Encoder motor1(PTD0,PTC4); // motor 1 is from encoder, otherwise it would be a pain in the ass to change all that code to motorencoder
-
+Encoder motor1(PTD0,PTC4, true); // motor 1 is from encoder, otherwise it would be a pain in the ass to change all that code to motorencoder
+//QEI motor1(PTD0, PTC4, NC, 64, QEI::X4_ENCODING);       // maybe the speed readout works when using X4 decoding... But this may break the code...
 
 float PwmPeriod = 0.0001f;
 
--- a/mbed.bld	Mon Oct 09 15:05:54 2017 +0000
+++ b/mbed.bld	Wed Oct 11 06:57:28 2017 +0000
@@ -1,1 +1,1 @@
-https://mbed.org/users/mbed_official/code/mbed/builds/235179ab3f27
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/235179ab3f27
\ No newline at end of file