Pololu Quk Motor Controller Driver

Dependents:   NavigationTest

Fork of PololuQik2 by stephen smitherman

Files at this revision

API Documentation at this revision

Comitter:
Fairy_Paolina
Date:
Thu Apr 03 15:24:59 2014 +0000
Parent:
1:df9964aaa00d
Commit message:
new;

Changed in this revision

PololuQik2.cpp Show annotated file Show diff for this revision Revisions of this file
PololuQik2.h Show annotated file Show diff for this revision Revisions of this file
diff -r df9964aaa00d -r 8d650b072fa8 PololuQik2.cpp
--- a/PololuQik2.cpp	Fri Mar 21 22:19:23 2014 +0000
+++ b/PololuQik2.cpp	Thu Apr 03 15:24:59 2014 +0000
@@ -79,9 +79,11 @@
     }
 }
 
-void PololuQik2::stopBothMotors() {
-    setMotor0Speed(1);
-    setMotor1Speed(1);
+void PololuQik2::stopBothMotors(int8_t speed) {
+    unsigned char message[] = {MOTOR0COASTPACKET, speed};
+    sendMessage(message , 2);
+    unsigned char message2[] = {MOTOR1COASTPACKET, speed};
+    sendMessage(message2 , 2);
 }
 
 void PololuQik2::sendMessage(unsigned char message[], uint8_t length) {
diff -r df9964aaa00d -r 8d650b072fa8 PololuQik2.h
--- a/PololuQik2.h	Fri Mar 21 22:19:23 2014 +0000
+++ b/PololuQik2.h	Thu Apr 03 15:24:59 2014 +0000
@@ -123,7 +123,7 @@
      * This is equivalent to called any of the forward or reverse methods
      * with the speed as zero (0).
      */
-    void stopBothMotors();
+    void stopBothMotors(int8_t speed);
 
     /**
      * retrieves the firmware version from the motor controller. This will return one of two values.