Stepper won't work.

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
junglemap
 
Posts: 8
Joined: Tue Oct 04, 2011 3:03 pm

Stepper won't work.

Post by junglemap »

Hi, I have an Atmega 328 and a motor shield with a bipolar stepper. I'm using a Mac. When I load the code to run it I get the following message: "AF_Stepper does not name a type"
I read in a forum that I didn't have the proper software library so I downloaded: adafruit-Adafruit-Motor-Shield-library-3a4bad1.zip I uncompressed it and renamed it AFmotor I restarted Arduino software and I get same "AF_Stepper does not name a type" Error... Whats missing???


This is my code:

#include <AFMotor.h>


AF_Stepper motor(200, 2);


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

motor.setSpeed(10); // 10 rpm

motor.step(100, FORWARD, SINGLE);
motor.release();
delay(1000);
}

void loop() {
motor.step(100, FORWARD, SINGLE);
motor.step(100, BACKWARD, SINGLE);

motor.step(100, FORWARD, DOUBLE);
motor.step(100, BACKWARD, DOUBLE);

motor.step(100, FORWARD, INTERLEAVE);
motor.step(100, BACKWARD, INTERLEAVE);

motor.step(100, FORWARD, MICROSTEP);
motor.step(100, BACKWARD, MICROSTEP);
}

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

Re: Stepper won't work.

Post by adafruit_support_bill »

Where did you put the renamed folder? It must be in the Libraries folder.
http://www.ladyada.net/library/arduino/libraries.html

junglemap
 
Posts: 8
Joined: Tue Oct 04, 2011 3:03 pm

Re: Stepper won't work.

Post by junglemap »

There is no libraries folder that I could find related to the Arduino when I did a search. I downloaded the newest Arduino software. There still is no Arduino libraries folder anywhere on my computer. I made a new folder labeled "Libraries" inside that folder I put a folder labeled "AFmotor" with the Adafruit Motor Shield library inside. I restarted the Arduino application and I get the same error message when I verify: "AF_Stepper does not name a type"

So, I put all these folders in the Arduino folder.. It now works

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

Re: Stepper won't work.

Post by adafruit_support_bill »

So, I put all these folders in the Arduino folder.. It now works
Sometimes you need to create the "Libraries" folder for the first library you install. The Arduino IDE installer doesn't do that for you.

junglemap
 
Posts: 8
Joined: Tue Oct 04, 2011 3:03 pm

Re: Stepper won't work.

Post by junglemap »

Thanks!

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

Return to “Arduino Shields from Adafruit”