X-Git-Url: http://git.piffa.net/web?a=blobdiff_plain;f=motors%2Fstepper%2Fstep_4_phase_ardino_library%2Fstep_4_phase_ardino_library.ino;fp=motors%2Fstepper%2Fstep_4_phase_ardino_library%2Fstep_4_phase_ardino_library.ino;h=0000000000000000000000000000000000000000;hb=daadffcffaf4c0618a6008c7582ceb92aaae64ed;hp=a2ab28e423a415e1780c1113320169395ce2def2;hpb=bed0e6592e7e7fc144a3787ce0dcb20556aff7db;p=sketchbook_andrea diff --git a/motors/stepper/step_4_phase_ardino_library/step_4_phase_ardino_library.ino b/motors/stepper/step_4_phase_ardino_library/step_4_phase_ardino_library.ino deleted file mode 100644 index a2ab28e..0000000 --- a/motors/stepper/step_4_phase_ardino_library/step_4_phase_ardino_library.ino +++ /dev/null @@ -1,56 +0,0 @@ -/* YourDuino.com Example Software Sketch - Small Stepper Motor and Driver V1.3 11/30/2013 - http://arduino-direct.com/sunshop/index.php?l=product_detail&p=126 - Shows 4-step sequence, Then 1/2 turn and back different speeds - terry@yourduino.com */ - -/*-----( Import needed libraries )-----*/ -#include - -/*-----( Declare Constants, Pin Numbers )-----*/ -//---( Number of steps per revolution of INTERNAL motor in 4-step mode )--- -#define STEPS_PER_MOTOR_REVOLUTION 32 - -//---( Steps per OUTPUT SHAFT of gear reduction )--- -#define STEPS_PER_OUTPUT_REVOLUTION 32 * 64 //2048 - -/*-----( Declare objects )-----*/ -// create an instance of the stepper class, specifying -// the number of steps of the motor and the pins it's -// attached to - -//The pin connections need to be 4 pins connected -// to Motor Driver In1, In2, In3, In4 and then the pins entered -// here in the sequence 1-3-2-4 for proper sequencing -Stepper small_stepper(STEPS_PER_MOTOR_REVOLUTION, 8, 10, 9, 11); - - -/*-----( Declare Variables )-----*/ -int Steps2Take; - -void setup() /*----( SETUP: RUNS ONCE )----*/ -{ -// Nothing (Stepper Library sets pins as outputs) -}/*--(end setup )---*/ - -void loop() /*----( LOOP: RUNS CONSTANTLY )----*/ -{ - small_stepper.setSpeed(1); // SLOWLY Show the 4 step sequence - Steps2Take = 4; // Rotate CW - small_stepper.step(Steps2Take); - delay(2000); - - Steps2Take = STEPS_PER_OUTPUT_REVOLUTION / 2; // Rotate CW 1/2 turn - small_stepper.setSpeed(100); - small_stepper.step(Steps2Take); - delay(1000); - - Steps2Take = - STEPS_PER_OUTPUT_REVOLUTION / 2; // Rotate CCW 1/2 turn - small_stepper.setSpeed(700); // 700 a good max speed?? - small_stepper.step(Steps2Take); - delay(2000); - -}/* --(end main loop )-- */ - -/* ( THE END ) */ -