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: mbed-rtos mbed PinDetect
Fork of FinalMotorControl by
Revision 0:bd78e433db61, committed 2016-02-29
- Comitter:
- rlanghbv
- Date:
- Mon Feb 29 12:10:54 2016 +0000
- Child:
- 1:a3287196a9b3
- Commit message:
- Firtst Commit
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Mon Feb 29 12:10:54 2016 +0000
@@ -0,0 +1,75 @@
+#include "mbed.h"
+
+
+DigitalOut IN1(D3);
+DigitalOut IN2(D4);
+
+DigitalOut IN3(D5);
+DigitalOut IN4(D6);
+
+
+DigitalIn SW(USER_BUTTON);
+
+void step4Right()
+{
+ IN1=0;
+ IN2=1;
+ IN3=0;
+ IN4=1;
+ wait_us(1000);
+ IN1=0;
+ IN2=1;
+ IN3=1;
+ IN4=0;
+ wait_us(1000);
+ IN1=1;
+ IN2=0;
+ IN3=1;
+ IN4=0;
+ wait_us(1000);
+ IN1=1;
+ IN2=0;
+ IN3=0;
+ IN4=1;
+ wait_us(1000);
+}
+
+
+void step4Left()
+{
+ IN1=1;
+ IN2=0;
+ IN3=0;
+ IN4=1;
+ wait_us(1000);
+
+ IN1=1;
+ IN2=0;
+ IN3=1;
+ IN4=0;
+ wait_us(1000);
+
+ IN1=0;
+ IN2=1;
+ IN3=1;
+ IN4=0;
+ wait_us(1000);
+
+ IN1=0;
+ IN2=1;
+ IN3=0;
+ IN4=1;
+ wait_us(1000);
+}
+
+
+int main()
+{
+ while (true) {
+ if(SW==1)
+ step4Left();
+ else
+ step4Right();
+
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Feb 29 12:10:54 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/252557024ec3 \ No newline at end of file
