Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. {{backlinks>.}} ===== Schrittmotor ===== Siehe http://42bots.com/tutorials/28byj-48-stepper-motor-with-uln2003-driver-and-arduino-uno/ ==== Software ==== * http://www.airspayce.com/mikem/arduino/AccelStepper/ (soll gut funktionieren, nicht getestet). ==== Eigener Code ==== <code c++ stepmotor28byh-48.ino> #define PINA 8 #define PINB 9 #define PINC 10 #define PIND 11 int pins[] = {PINA, PINB, PINC, PIND}; void setup() { for (int i=0; i<4; i++) { pinMode(pins[i], OUTPUT); } } void step(int s) { if (s<0 || s>7) { for (int i=0; i<4; i++) { digitalWrite(pins[i], LOW); } } else { int on = LOW; for (int i=0; i<4; i++) { if (i==s/2 || i==(s/2+s%2)%4) { on = HIGH; } else { on = LOW; } digitalWrite(pins[i], on); } } } int dly = 1; void loop() { for (int i=0; i<512; i++) { step(i % 8); delay(dly); } step(-1); delay(200); for (int i=511; i>0; i--) { step(i % 8); delay(dly); } step(-1); delay(500); } </code> lehrkraefte/blc/math/formi/stepper.txt Last modified: 2017/02/25 14:58by Ivo Blöchliger