Mateusz Grzywacz / Yellow2WheeledRobot_motor_shield
Revision:
4:aef786c67b2d
Parent:
3:c656543830df
Child:
5:6dbb019203e9
--- a/YellowMotors.h	Thu Feb 04 15:45:09 2016 +0000
+++ b/YellowMotors.h	Fri Feb 05 15:49:11 2016 +0000
@@ -8,7 +8,6 @@
 
 #include "mbed.h"
 extern Serial pc;
-
 // this is rather strange case, because my motors aren't performing both well. Left one has far weaker, causing delayed start-up and lower RPM. Thus my functions differ. I have a whole bigass spreadsheet of graphs and calculations by the way.
 float motorLinearizationL(float);  // left motor is worse. at max desired speed it'll run at full 100% speed. this is thus weaker compensation.
 float motorLinearizationR(float);  //  this is stronger compensation for more powerful motor. it runs it at < 100% speed
@@ -18,6 +17,7 @@
 // It could that the motors get pointers to their linearization functions and macros at the initalization, but, meh, I'm not that passionate about C++.
 {
 private:
+    DigitalOut *_led; // debug diode. lights up during shifting to register
     DigitalOut _clk;
     DigitalOut _lat;
     DigitalOut _dat;
@@ -25,6 +25,7 @@
     char _directions;
     PinName Lpwm;
     PinName Rpwm;
+    void _init();
     class MotorItself  // define a class for separate motors objects.
     {
     private:
@@ -62,6 +63,10 @@
     void operator= (const float value);
     void set(float value, int whichMotor = -1);
     float get(int whichMotor = -1);
+    void attachled(DigitalOut & led);
+    void dettachled() {
+        delete _led;
+    } ;
 };
 
 #endif
\ No newline at end of file