• Witaj na Forum Arduino Polska! Zapraszamy do rejestracji!
  • Znajdziesz tutaj wiele informacji na temat hardware / software.
Witaj! Logowanie Rejestracja


Ocena wątku:
  • 0 głosów - średnia: 0
  • 1
  • 2
  • 3
  • 4
  • 5
28BYJ-48 Prędkość Maxymalna
#1
Witam,  próbuję  uzyskać prędkość maksymalną tego ustrojstwa i nie wiem czy coś źle ustawiłem czy jest to po prostu takie wolne.
Kod:
#include <Stepper.h>
long dick = 0;

/*-----( Declare Constants, Pin Numbers )-----*/
//---( Number of steps per revolution of INTERNAL motor in 4-step mode )---
#define STEPS_PER_MOTOR_REVOLUTION 32  

//---( Steps per OUTPUT SHAFT of gear reduction )---
#define STEPS_PER_OUTPUT_REVOLUTION 32 * 64  //2048  

/*-----( Declare objects )-----*/
// create an instance of the stepper class, specifying
// the number of steps of the motor and the pins it's
// attached to

//The pin connections need to be 4 pins connected
// to Motor Driver In1, In2, In3, In4  and then the pins entered
// here in the sequence 1-3-2-4 for proper sequencing
Stepper small_stepper(STEPS_PER_MOTOR_REVOLUTION, 11, 10, 9, 8);


/*-----( Declare Variables )-----*/
int  Steps2Take;

void setup()   /*----( SETUP: RUNS ONCE )----*/
{
// Nothing  (Stepper Library sets pins as outputs)
Serial.begin(9600);
}/*--(end setup )---*/

void loop()   /*----( LOOP: RUNS CONSTANTLY )----*/
{

  Steps2Take  =  STEPS_PER_OUTPUT_REVOLUTION / 1;  // Rotate CW 1/2 turn
  small_stepper.setSpeed(120);  
  small_stepper.step(Steps2Take);
  //delay(1000);
  dick++;
  Serial.print("dick:");
Serial.println(dick);
 
Odpowiedź
#2
small_stepper.setSpeed(120);
Próbowałeś zmieniać ta wartość pyzatym ta krokówkę się prosto obsługuje ni konieczna jest biblioteka.
[Obrazek: banerelektronika.jpg]



Jeśli pomogłem podziękuj punktem reputacji Wink
 
Odpowiedź
  


Skocz do:


Przeglądający: 1 gości