tim004 tim004
/
Projekat2
Porca Sumejja ALmir Husic
Revision 0:6051895680ca, committed 2014-05-19
- Comitter:
- tim004
- Date:
- Mon May 19 14:22:14 2014 +0000
- Commit message:
- Projekat; pomocni dio ;
Changed in this revision
diff -r 000000000000 -r 6051895680ca main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon May 19 14:22:14 2014 +0000 @@ -0,0 +1,19 @@ +#include "mbed.h" +#include "sMotor.h" + +sMotor motor(dp9, dp10, dp11, dp13); // creates new stepper motor: IN1, IN2, IN3, IN4 + +int step_speed = 1200 ; // set default motor speed +int numstep = 512 ; // defines full turn of 360 degree +int direction = 0; //0 for right, 1 for left + +int main() { + + int angle(0); + while (1) { + + motor.step(numstep / 360 * (angle % 360), direction, step_speed); // number of steps, direction, speed + angle++; + wait(0.1); + } +} \ No newline at end of file
diff -r 000000000000 -r 6051895680ca mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon May 19 14:22:14 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/8a40adfe8776 \ No newline at end of file
diff -r 000000000000 -r 6051895680ca sMotor.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sMotor.lib Mon May 19 14:22:14 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/XtaticO/code/sMotor/#4b3b9e047ce3