Permalink
Browse files

Release motor after stepping to avoid overheat

  • Loading branch information...
dnet committed Aug 20, 2010
1 parent cdfe6d4 commit 2d07778db7412a9cdf4535bd0a9503c70069439c
Showing with 8 additions and 0 deletions.
  1. +8 −0 hack2o.pde
View
@@ -35,15 +35,23 @@ Stepper myStepper(100, 8, 10, 9, 11);
byte i2cmd;
byte letgo = 0;
+void release_motor() {
+ Serial.print(" (motor off)");
+ for (byte i = 8; i < 12; i++)
+ digitalWrite(i, LOW);
+}
+
void move2bottom() {
Serial.print("Moving to bottom position...");
while (digitalRead(7) == HIGH) myStepper.step(-25);
+ release_motor();
Serial.println(" done");
}
void move2top() {
Serial.print("Moving to top position...");
myStepper.step(HEIGHT);
+ release_motor();
Serial.println(" done");
}

0 comments on commit 2d07778

Please sign in to comment.