Hallo,
erst einmal vorweg, ich bin noch komplett unerfahren im Bezug auf die Arduino-Programmierung und muss/möchte mich jetzt im Zuge eines Uniprojektes damit auseinandersetzen.
Dabei scheitere ich leider schon an einer vermutlich einfachen Aufgabe, der Ansteuerung eines Stepper Motors über das Arduino Shield.
Ich habe es mithilfe dieses Tutorials versucht http://www.instructables.com/id/Arduino-Motor-Shield-Tutorial/?ALLSTEPS, bekomme den Motor aber einfach nicht zum Laufen. Anstatt zu rotieren, bewegt er sich lediglich minimal vor- und zurück. Ich denke, dass es an der Polung des Motors liegt.
Könnt ihr mir sagen in welcher Reihenfolge ich den Schrittmotor anschließen muss? Er ist bipolar, hat somit ja 4 Kabel. Am Shield gibt es 2 Channel mit je "+" und "-". Wie muss ich die Kabel nun verbinden?
Hier nochmal der kopierte Code des zuvor angesprochenen Tutorials:
/*************************************************************
Motor Shield Stepper Demo
by Randy SarafanFor more information see:
http://www.instructables.com/id/Arduino-Motor-Shield-Tutorial/*************************************************************/
int delaylegnth = 30;
void setup() {
//establish motor direction toggle pins
pinMode(12, OUTPUT); //CH A -- HIGH = forwards and LOW = backwards???
pinMode(13, OUTPUT); //CH B -- HIGH = forwards and LOW = backwards???//establish motor brake pins
pinMode(9, OUTPUT); //brake (disable) CH A
pinMode(8, OUTPUT); //brake (disable) CH B}
void loop(){
digitalWrite(9, LOW); //ENABLE CH A
digitalWrite(8, HIGH); //DISABLE CH BdigitalWrite(12, HIGH); //Sets direction of CH A
analogWrite(3, 255); //Moves CH Adelay(delaylegnth);
digitalWrite(9, HIGH); //DISABLE CH A
digitalWrite(8, LOW); //ENABLE CH BdigitalWrite(13, LOW); //Sets direction of CH B
analogWrite(11, 255); //Moves CH Bdelay(delaylegnth);
digitalWrite(9, LOW); //ENABLE CH A
digitalWrite(8, HIGH); //DISABLE CH BdigitalWrite(12, LOW); //Sets direction of CH A
analogWrite(3, 255); //Moves CH Adelay(delaylegnth);
digitalWrite(9, HIGH); //DISABLE CH A
digitalWrite(8, LOW); //ENABLE CH BdigitalWrite(13, HIGH); //Sets direction of CH B
analogWrite(11, 255); //Moves CH Bdelay(delaylegnth);
}
Vielen Dank!
Julian