I just need to move this project to Mbed Studio since online compiler is not working at the moment

Dependencies:   mbed F042K6_USBDevice

Files at this revision

API Documentation at this revision

Comitter:
Azureta
Date:
Sat May 16 11:17:10 2020 +0000
Commit message:
need to move to Studio since online compiler doesn't work

Changed in this revision

F042K6_USBDevice.lib Show annotated file Show diff for this revision Revisions of this file
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
diff -r 000000000000 -r 795d2bf38fe9 F042K6_USBDevice.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/F042K6_USBDevice.lib	Sat May 16 11:17:10 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/va009039/code/F042K6_USBDevice/#0ba7c5e2b3dc
diff -r 000000000000 -r 795d2bf38fe9 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat May 16 11:17:10 2020 +0000
@@ -0,0 +1,49 @@
+// https://developer.mbed.org/handbook/USBSerial
+// + driver https://os.mbed.com/media/uploads/samux/serial.zip
+
+#include "mbed.h"
+#include "USBSerial.h"
+
+DigitalOut pulse(PA_7);
+DigitalOut direction(PA_6);
+
+unsigned int pulDelay = 1;
+unsigned int cnt = 0;
+int dir = 0;
+int prev_dir = 1;
+
+
+int main() {
+    
+    SYSCFG->CFGR1 |=0x10;   //Pins PA11/12 instead of pins PA9/10 (umo��uje pou��t USB)
+    USBSerial serial;
+    
+    serial.printf("MBED virtual serial port!\r\n");
+    wait_ms(500);
+    
+    
+    
+    while(1){
+        direction.write(0);
+        while(cnt<=10000){
+            pulse.write(1);
+            wait_ms(pulDelay);
+            pulse.write(0);
+            wait_ms(pulDelay);
+            cnt ++;
+        }
+        wait_ms(5000);
+        cnt = 0;
+        direction.write(1);
+        while(cnt<=10000){
+            pulse.write(1);
+            wait_ms(pulDelay);
+            pulse.write(0);
+            wait_ms(pulDelay);
+            cnt ++;
+        }
+        wait_ms(5000);
+        cnt = 0;
+        
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r 795d2bf38fe9 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat May 16 11:17:10 2020 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/mbed_official/code/mbed/builds/a330f0fddbec
\ No newline at end of file