From 62b75b4f4ff519a8d12f081c69d4ef39a8286f68 Mon Sep 17 00:00:00 2001 From: shrkey Date: Mon, 26 Sep 2016 00:19:27 +0100 Subject: [PATCH] stepper --- 640.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/640.md b/640.md index de059a4..9920b29 100644 --- a/640.md +++ b/640.md @@ -105,7 +105,7 @@ The off command will switch off the motor and apply the brakes m1.off() ``` -##### setMotorSpeed( *speed*) +##### setMotorSpeed( *speed* ) We can also stop the motor by using the second command and passing a speed of 0 @@ -226,6 +226,21 @@ stepper1.setMotorSpeed(200) ##### oneStep( *direction*, *style* ) +This command will move the stepper motor one step in your chosen direction - + +- **dw_Controller.FORWARD** - set the stepper motor to move forward +- **dw_Controller.REVERSE** - set the stepper motor to move backwards + +There are two stepping styles available - + +- **dw_Controller.SINGLE** - this is the simplest method of stepping which activates a single coil at a time to move and hold the motor. This method uses the least amount of power. +- **dw_Controller.DOUBLE** - this is a slightly more complex method of stepping which uses to coils to move and hold the motor. This method uses twice as much power as the single step, but is more powerful. + +``` python +stepper1.oneStep(dw_Controller.FORWARD, dw_Controller.SINGLE) +stepper1.oneStep(dw_Controller.REVERSE, dw_Controller.DOUBLE) +``` + ##### step( *steps*, *direction*, *style* ) ## C++