A program to monitor some parameters for a motor

Dependencies:   mbed-dev BufferSerial

Thanks to David Lowe for https://developer.mbed.org/users/gregeric/code/Nucleo_Hello_Encoder/ which I adapted for the use of TIM2 32bit timer as an encoder reader on the Nucleo L432KC board.

Revision:
11:7a9837acbea0
Parent:
10:8862c8779b71
Child:
12:8c355d78e081
--- a/main.cpp	Tue May 30 22:35:08 2017 +0000
+++ b/main.cpp	Tue May 30 22:41:23 2017 +0000
@@ -157,7 +157,7 @@
     
     printf("Time is %lu microseconds, position modified %ld %lu %lu\r\n", deltaT, pos, pos1, pos2);
     if (deltaT > 0){
-        speed = ((float) pos)*12.5f/((float) deltaT); // (pulses/us)*1000000/8000 -> rot/s
+        speed = ((float) pos)*125.f/((float) deltaT); // (pulses/us)*1000000/8000 -> rot/s
         }
     else {
         printf("Error, time interval not greater than zero, speed not calculated!\r\n");