SmartWheels self-driving race car. Designed for NXP Cup. Uses FRDM-KL25Z, area-scan camera, and simple image processing to detect and navigate any NXP spec track.

Dependencies:   TSI USBDevice mbed-dev

Fork of SmartWheels by haofan Zheng

Revision:
4:25e028102625
Child:
8:92f6baeea027
diff -r c8867972ffc7 -r 25e028102625 Motor.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Motor.h	Thu Feb 02 23:30:41 2017 +0000
@@ -0,0 +1,33 @@
+#pragma once
+#include "mbed.h"
+
+class Motor{
+
+public:
+
+    Motor();
+    
+    ~Motor();
+    
+    static void setLeftSpeed(int speed);
+    
+    static void setRightSpeed(int speed);
+    
+    static void setSpeeds(int speedLeft, int speedRight);
+
+private:
+
+    static inline void init()
+    {
+        static bool initialized = false;
+        
+        if(!initialized)
+        {
+            initialized = true;
+            initializeMotor();
+        }    
+    }
+    
+    static void initializeMotor();
+
+};
\ No newline at end of file