Is AFMotor library working with Uno R3

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
Hyojin
 
Posts: 4
Joined: Sat Feb 25, 2012 11:53 pm

Is AFMotor library working with Uno R3

Post by Hyojin »

Hi~

I used to control PF35T-48L4 motor with AF_Stepper (AFMotor library) using Arduino Mega.
A week ago, I bought Arduino UNO R3 and tried to control same motor, but it did not work.
I searched foum but I could not get a right answer for this.

Anybody tried AFMotor library with UNO R3?

Many thanks.
Hyojin :D

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Is AFMotor library working with Uno R3

Post by adafruit_support_bill »

It should work fine on an R3. Are you sure no connections got knocked loose in the move from the Mega? Do the library example sketches work?

Hyojin
 
Posts: 4
Joined: Sat Feb 25, 2012 11:53 pm

Re: Is AFMotor library working with Uno R3

Post by Hyojin »

Thanks for the reply.

Following is my test code and it worked for previous Arduino but never worked with UNO R3.
I am using 6 wire motor(PF35T-48L4) and I wired it same as before.
I tested UNO R3 with string example and it worked fine so it is not the problem of UNO R3 itself.

#include <AFMotor.h>

AF_Stepper motor(48, 2); //Steps indicates how many steps per revolution the motor has. a 7.5degree/step motor has 360/7.5 = 48 steps
int x;

void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Stepper test!");
motor.setSpeed(10); // 10 rpm
}

void loop() {
while(Serial.available()>0){
x = Serial.read();
}
motor.step(x, FORWARD, SINGLE);
motor.step(x, BACKWARD, SINGLE);

}

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Is AFMotor library working with Uno R3

Post by adafruit_support_bill »

Following is my test code and it worked for previous Arduino but never worked with UNO R3.
What exactly do you expect from this code?
What does it do differently on the Mega?

Hyojin
 
Posts: 4
Joined: Sat Feb 25, 2012 11:53 pm

Re: Is AFMotor library working with Uno R3

Post by Hyojin »

Thank you for prompt reply..

I just want to move my motor as stepper with serial input.
With UNO R3, motor.step(1, FORWARD, SINGLE) function just did not work at all.
That's why I thought AFMotor library is not compatible with UNO R3.
I used just same motor and codes except arduino board.

Mayby there is something wrong with wring..
I attached wiring picture...

Thanks.
Hyojin
Attachments
wring.jpg
wring.jpg (63.29 KiB) Viewed 1286 times

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Is AFMotor library working with Uno R3

Post by adafruit_support_bill »

Your wiring looks fine. I see that you have the jumper installed to use power from the Arduino. How is the Arduino powered?

Hyojin
 
Posts: 4
Joined: Sat Feb 25, 2012 11:53 pm

Re: Is AFMotor library working with Uno R3

Post by Hyojin »

I connected PC and arduino with USB cable.
so only USB is the power source.
How should I configure jumper?

Thanks.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Is AFMotor library working with Uno R3

Post by adafruit_support_bill »

To share power with the Arduino it should be installed as you have it. One possible problem is that USB power is very limited, but it is usually enough to drive these small motors.

If you have another power supply, you can try removing the power jumper and connecting your external supply to the External Power terminals near the jumper. (Double check the polarity before you connect).

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”