Is AFMotor library working with Uno R3

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

Moderators: adafruit_support_bill, adafruit

Is AFMotor library working with Uno R3

Postby Hyojin » Sat Feb 25, 2012 11:11 pm

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
Hyojin
 
Posts: 4
Joined: Sat Feb 25, 2012 10:53 pm

Re: Is AFMotor library working with Uno R3

Postby adafruit_support_bill » Sun Feb 26, 2012 7:06 am

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?
User avatar
adafruit_support_bill
 
Posts: 15975
Joined: Sat Feb 07, 2009 9:11 am

Re: Is AFMotor library working with Uno R3

Postby Hyojin » Sun Feb 26, 2012 5:31 pm

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);

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

Re: Is AFMotor library working with Uno R3

Postby adafruit_support_bill » Sun Feb 26, 2012 6:54 pm

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?
User avatar
adafruit_support_bill
 
Posts: 15975
Joined: Sat Feb 07, 2009 9:11 am

Re: Is AFMotor library working with Uno R3

Postby Hyojin » Sun Feb 26, 2012 7:57 pm

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 898 times
Hyojin
 
Posts: 4
Joined: Sat Feb 25, 2012 10:53 pm

Re: Is AFMotor library working with Uno R3

Postby adafruit_support_bill » Mon Feb 27, 2012 5:52 am

Your wiring looks fine. I see that you have the jumper installed to use power from the Arduino. How is the Arduino powered?
User avatar
adafruit_support_bill
 
Posts: 15975
Joined: Sat Feb 07, 2009 9:11 am

Re: Is AFMotor library working with Uno R3

Postby Hyojin » Mon Feb 27, 2012 10:04 pm

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

Thanks.
Hyojin
 
Posts: 4
Joined: Sat Feb 25, 2012 10:53 pm

Re: Is AFMotor library working with Uno R3

Postby adafruit_support_bill » Tue Feb 28, 2012 5:54 am

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).
User avatar
adafruit_support_bill
 
Posts: 15975
Joined: Sat Feb 07, 2009 9:11 am


Return to Arduino Shields from Adafruit

Who is online

Users browsing this forum: No registered users and 5 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [100]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
Android[6]
 
BeagleBone[24]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[33]
LCDs & Displays[48]
Components & Parts[69]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[108]
 
Wireless[14]
Cables[60]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[69]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]