Hallo Freunde !
Ich habe für einen kleinen "Stullenbrett-Bot" zwei Pololu Steppermotore SY35ST28-0504A vorgesehen. Um nicht erst mal eigene Routinen der Steuerung zu entwickeln,
habe ich mal schnell was mit der Stepper.lib vom Arduino und einem L298-Treiberboard aufgebaut.
Es soll der Motor nun zBsp. nach 1 Umdrehung anhalten (200x1,8°) ....er dreht er aber wacker ständig weiter.
Habe ich die Stepperlib falsch verstanden oder was mache ich falsch??
Hier mal der Testsketch:
Vielleicht hatja wer einen Tip für mich , was ich da falsch mache oder sehe ??Code:/* Steppertest * A Stepper motor follows the turns of a potentiometer * (or other sensor) on analog input 0. * * http://www.arduino.cc/en/Reference/Stepper * This example code is in the public domain. */ #include <Stepper.h> // change this to the number of steps on your motor #define STEPS 100 // Speed // create an instance of the Stepper class, specifying // the number of steps of the motor and the pins it's // attached to : // L298 IN1 = 8 // L298 IN2 = 9 // L298 IN3 = 10 // L298 IN4 = 11 // L298 ENA = 2 // L298 ENB = 3 Stepper stepper(STEPS, 8, 9, 10, 11); ; void setup() { // set the speed of the motor to 60 RPMs stepper.setSpeed(60); pinMode(2,OUTPUT); // ENA pinMode(3,OUTPUT); // ENB digitalWrite(2,HIGH); // ENA = 1 digitalWrite(3,HIGH); // ENB = 1 } void loop() { while(1) { stepper.step(200); //????????? das habe ich als 200 Steppschritte angesehen, als 360° bei 1,8° Stepps } }
Gruss und Danke
Gerhard







Zitieren

Lesezeichen