Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 1:35b072614734
- Parent:
- 0:8a42934ad23a
--- a/main.cpp Thu Feb 20 04:56:44 2014 +0000
+++ b/main.cpp Thu Dec 10 09:39:58 2015 +0000
@@ -1,11 +1,22 @@
#include "mbed.h"
#include "VNH5019MC.h"
+#define M1EN p27
+#define M1INA p23
+#define M1INB p24
+#define M1PWM p25
+
+#define M2EN p30
+#define M2INA p28
+#define M2INB p29
+#define M2PWM p26
+
DigitalOut led1(LED1);
Serial pc(USBTX, USBRX);
// Motor
-VNH5019MC motor(p19, p20, p21, p22);
+VNH5019MC motor1(M1EN, M1INA, M1INB, M1PWM);
+//VNH5019MC motor2(M2EN, M2INA, M2INB, M2PWM);
int main() {
pc.printf("\r\n\r\n\r\n");
@@ -20,8 +31,9 @@
if (increment) duty++;
else duty--;
- motor.move(duty);
+ motor1.move(duty);
+
led1 = !led1;
- wait(0.2);
+ wait(0.05);
}
}
\ No newline at end of file