Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Como utilizar dos motores stepper
26-04-2015, 06:04 PM,
#1
Como utilizar dos motores stepper
En Arduino sería por ejemplo:
Stepper small_stepper(STEPS, motorPin1, motorPin3, motorPin2, motorPin4);

En Pinguino?
Reply
29-04-2015, 09:45 AM, (This post was last modified: 29-04-2015, 09:46 AM by regis.)
#2
RE: Como utilizar dos motores stepper
Pinguino IDE > examples/05.Control/Stepper/stepper_oneRevolution.pde

// change this to fit the number of steps per revolution for your motor

const int stepsPerRevolution = 48;

void setup()
{
// initialize the stepper library on pins 0 through 3:
Stepper.init(stepsPerRevolution,0,1,2,3);
// set the speed at 60 rpm:
Stepper.setSpeed(60);
// initialize the serial port:
Serial.begin(9600);
}

void loop()
{
// step one revolution in one direction:
Serial.println("clockwise");
Stepper.step(stepsPerRevolution);
delay(500);

// step one revolution in the other direction:
Serial.println("counterclockwise");
Stepper.step(-stepsPerRevolution);
delay(500);
}
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
06-05-2015, 09:14 AM, (This post was last modified: 06-05-2015, 09:15 AM by ermendaa.)
#3
RE: Como utilizar dos motores stepper
(29-04-2015, 09:45 AM)regis Wrote: First thank you for answering , secondly I say I think I have not expressed well or not understood my question .
I want to know how to use two stepper motors, stepper library with Penguin , because Arduino is easy as you can make an alias (I think it says so) to that library , as an example
stepper.motor1 (....
stepper.motor2 (....

greetings (sorry for my english)
Reply
12-05-2015, 12:33 PM,
#4
RE: Como utilizar dos motores stepper
This is still something to do ...
Do you want to modify the code of the existing stepper lib. to manage several steppers ?
You could defined a function stepper.attach() just as we did with the servo lib. :
stepper.attach(u8 stepper_number, u8 pin1, u8 pin2, u8 pin3, u8 pin4)
Any other idea is welcome.
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)