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.
Dependencies: Motor_Driver_V2 mbed
Diff: main.cpp
- Revision:
- 0:667eb2a74dbf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sun Jan 27 10:56:56 2019 +0000
@@ -0,0 +1,28 @@
+#include "mbed.h"
+#include "motor.h"
+
+//format : PWM, pin digital (buat nentuin arah)
+motor motor1 (PA_9, PA_8);
+motor motor2 (PA_7, PC_7);
+motor motor3 (PA_5, PC_8);
+
+// Serial
+Serial pc(USBTX,USBRX,115200);
+
+int main()
+{
+
+ while(1)
+ {
+ motor1.setpwm(0.3);
+ motor2.setpwm(0.3);
+ motor3.setpwm(0.3);
+ wait(3);
+ motor1.setpwm(-0.3);
+ motor2.setpwm(-0.3);
+ motor3.setpwm(-0.3);
+ wait(3);
+
+
+ }
+}