Ivan Novak / Mbed 2 deprecated uStep111

Dependencies:   mbed uStep11

Files at this revision

API Documentation at this revision

Comitter:
inovak1
Date:
Mon Jan 09 14:13:32 2017 +0000
Commit message:
a

Changed in this revision

mbed.bld Show annotated file Show diff for this revision Revisions of this file
step.cpp Show annotated file Show diff for this revision Revisions of this file
uStep.lib Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Jan 09 14:13:32 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9baf128c2fab
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/step.cpp	Mon Jan 09 14:13:32 2017 +0000
@@ -0,0 +1,37 @@
+#include "mbed.h"
+#include "uStep.h"
+Ticker ticki;
+DigitalIn buttondown(PTE30);
+DigitalIn buttonup(PTC2);
+DigitalOut andrijinkriz1(PTE29);
+DigitalOut andrijinkriz2(PTE23);
+
+uStep motor(PTB8, PTB9,PTB10, PTB11);
+
+void task1(void)
+{
+    andrijinkriz1=!andrijinkriz1;
+    andrijinkriz2=!andrijinkriz1;
+}
+int step_brzina = 2000;
+int numstep = 512 ;
+
+int main()
+{
+    while (1) {
+        if(buttondown==0) {
+            ticki.attach(&task1,0.5);
+            motor.step(numstep/4,0,step_brzina);
+
+
+        }
+        if(buttonup==0) {
+
+            motor.step(numstep/4,1,step_brzina);
+            ticki.detach();
+            andrijinkriz1=0;
+            andrijinkriz2=0;
+
+        }
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uStep.lib	Mon Jan 09 14:13:32 2017 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/inovak1/code/uStep11/#1bf9280635a4