program for ping pong robot

Dependencies:   mbed

Revision:
0:14b64813c04d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MISC.h	Wed Jun 29 00:02:00 2016 +0000
@@ -0,0 +1,37 @@
+
+//class for useful functions
+class MISC
+{
+
+protected:
+
+public:
+
+    //function for easy convertion int -> str
+    char* intToString(int x) {
+        char tmp[16] = "               ";
+        sprintf(tmp, "%d", x);
+        return tmp;
+    }
+
+    //function for easy convertion float -> str
+    char* floatToString(float x) {
+        char tmp[20] = "                   ";
+        sprintf(tmp, "%f", x);
+        return tmp;
+    }
+
+    //funtion to cut off too high values
+    int ValCut(int val) {
+        if(val > 400) {
+            return 400;
+        } else {
+            return val;
+        }
+    }
+
+};
+
+
+
+