Go Down

Topic: 'Release' when using a L293D and not a motorshield (Read 1 time) previous topic - next topic

Lubby

I'm trying to figure out how to release my bipolar stepper using a Arduino mini-pro and L293D h-bridge.
The project requires things to be as compact as possible so I do not want to use an easydriver or motorsheild if possible.

This is the code I have which is working:

Quote
#include <Stepper.h>

#define motorSteps 200     

#define Black 12
#define Green 13
#define Red 14
#define Blue 15
#define ledPin 13
int Step;

// initialize of the Stepper library:
Stepper myStepper(200, Black, Green, Red, Blue);


void setup() {
  // set the motor speed at 60 RPMS:
  myStepper.setSpeed(60);


Step = 0;

  // Initialize the Serial port:
  Serial.begin(9600);

  // set up the LED pin:
  pinMode(ledPin, OUTPUT);
  // blink the LED:
  blink(3);
}

void loop() {
 
  myStepper.setSpeed(10);
  // Step forward 100 steps:
  Serial.println("10 Rpm");
  myStepper.step(200); // forward one rotation
   delay(200);
 
myStepper.setSpeed(30);
  // Step forward 100 steps:
  Serial.println("1 Rpm");
  myStepper.step(-200); // back one rotation

   delay(175000); // delay just under 3 minutes
  }
}


rather than the (175000) delay above, I would prefer to 'release' or turn off the stepper for this duration -  Save energy and reduce the heat on the IC and motor.  It would then loop again.

I have been unable to track down the appropriate code to do so.  Any suggestions?
Thanks

Go Up