NEED HELP WITH ARDUINO AND STEPPER MOTOR CONFIGURATION

p_yves's icon

Hello everybody,

I have a Arduino uno connect to a Arduino Motor Shield r3, and i am trying to control a stepper motor from Maxuino (this one http://www.gotronic.fr/pj-784.pdf).
I have been following the Chris Coleman tutorial on vimeo but i might have a problem with the setting of the pin.

From the arduino software, this code works:

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 B

digitalWrite(12, HIGH); //Sets direction of CH A
analogWrite(3, 255); //Moves CH A

delay(delaylegnth);

digitalWrite(9, HIGH); //DISABLE CH A
digitalWrite(8, LOW); //ENABLE CH B

digitalWrite(13, LOW); //Sets direction of CH B
analogWrite(11, 255); //Moves CH B

delay(delaylegnth);

digitalWrite(9, LOW); //ENABLE CH A
digitalWrite(8, HIGH); //DISABLE CH B

digitalWrite(12, LOW); //Sets direction of CH A
analogWrite(3, 255); //Moves CH A

delay(delaylegnth);

digitalWrite(9, HIGH); //DISABLE CH A
digitalWrite(8, LOW); //ENABLE CH B

digitalWrite(13, HIGH); //Sets direction of CH B
analogWrite(11, 255); //Moves CH B

delay(delaylegnth);

}

But in Maxuino it doesn't works. The lights on the motor shield board arent moving the same way, as if the pins wasn't setting up correctly, but i can't found how to solve it.

It is kind of an emergency, i'm trying to make it work for friday. If someone has any idea that could help me to understand whats going on, i will be glad to read it. Thanks in advance!

Pierre

IMG_00131.jpg
jpg
vichug's icon

isn't maxuino supposed to work exclusively with a StandardFirmata arduino sketch ?

Scott Fitzgerald's icon

Why not use what already works?

What use is firmata + maxuino?

What are you trying to accomplish?

p_yves's icon

Thx for your answers. I have used the configurable firmata has they explain on maxuino.org for controling stepper motor.
Actually i need max msp because i am synchronising a video content with a light rotation. Which means that i need to control this stepper motor with the frame rate of the video!

Anyone have already used the maxuino.maxhelp?