Arduino controlado de manera remota

La intencion de este proyecto es lograr una interface que nos permita controlar los movimientos de un motor paso a paso, por ejemplo, para controlar una webcam o pulsar los botones de un control remoto de un tv o para mover un robot... ud. decide que conecta, el caso es que lo pueda controlar via web usando processing, algun script de python o via OSC (open sound control) desde puredata.

Bien, lo primero es que hoy, 03122007, salio una libreria de tom igoe para controlar un motor paso a paso: http://www.arduino.cc/en/Tutorial/Stepper

con tal libreria instalada en el IDE de arduino podemos controlar el movimiento del motor:

void Stepper() - initialize a Stepper. , e.g.

Stepper myStepper = new Stepper();     // initialize a new Stepper


void attach(int pin1, int pin2, int pin3, int pin4) - attach four digital I/O pins to the stepper, e.g.

myStepper.attach(8,9,10,11);     // Attach pins 8 - 11 to the Stepper instance


int speed - set the Stepper's speed. Speed means the delay between steps in milliseconds e.g.

myStepper.speed = 50; // 50 ms between steps


int direction - set the motor's direction, 0 or 1. Physical direction depends on the way you wire the motor e.g.

myStepper.direction = 1; // direction = 1


void moveMotor(int numberOfSteps) - move the motor a number of steps. Direction depends on the Stepper.direction value. e.g.

myStepper.moveMotor(3); // moves the stepper 3 steps


void stepMotor(int thisStep) - moves the stepper one step, using the actual step values 0 - 3. Only for folks who know how steppers really work and want low level access e.g.

myStepper.stepMotor(0); // sets the stepper pins to 1010
myStepper.stepMotor(1); // sets the stepper pins to 0110
myStepper.stepMotor(2); // sets the stepper pins to 0101
myStepper.stepMotor(3); // sets the stepper pins to 1001

ALTRED: arduino2pap (last edited 2007-03-13 02:16:06 by alejoduque)