ada fruit motor shield

What is wrong with this code:

#include <AFMotor.h>
AF_Stepper motor(48, 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);
}

That's a bit like going to the Doctor and saying "What's wrong with me?"

It would help the Doctor if you started with "I have a headache and my vision is blurry".

So, what are the symptoms of your code? Does it compile? If not what are the error messages? If it does, what does it not do that you expect it to, and do that you don't expect?

There is an error when compiling the code. It says "Error compiling for board Arduino/Genuino Uno", and "Error status 1"

  1. Read instructions at top of forum on how to PROPERLY post questions and code.

  2. Post the COMPLETE error message. Use CODE TAGS for posting both code and error messages.

fatoumanajmadoctorchicken:
There is an error when compiling the code. It says "Error compiling for board Arduino/Genuino Uno", and "Error status 1"

That's not the complete error. Hit the Copy error messages button and then paste in your next post.

(And or scroll in the error pane, or drag it taller.)

Arduino: 1.8.5 (Windows 10), Board: "Arduino/Genuino Uno"

sketch_apr04b:2: error: 'AF_Stepper' does not name a type

AF_Stepper motor(48, 2);

^

C:\Users\325339570\Downloads\arduino-1.8.5-windows\arduino-1.8.5\portable\sketchbook\sketch_apr04b\sketch_apr04b.ino: In function 'void setup()':

sketch_apr04b:9: error: 'motor' was not declared in this scope

motor.setSpeed(10); // 10 rpm

^

sketch_apr04b:11: error: 'FORWARD' was not declared in this scope

motor.step(100, FORWARD, SINGLE);

^

sketch_apr04b:11: error: 'SINGLE' was not declared in this scope

motor.step(100, FORWARD, SINGLE);

^

C:\Users\325339570\Downloads\arduino-1.8.5-windows\arduino-1.8.5\portable\sketchbook\sketch_apr04b\sketch_apr04b.ino: In function 'void loop()':

sketch_apr04b:17: error: 'motor' was not declared in this scope

motor.step(100, FORWARD, SINGLE);

^

sketch_apr04b:17: error: 'FORWARD' was not declared in this scope

motor.step(100, FORWARD, SINGLE);

^

sketch_apr04b:17: error: 'SINGLE' was not declared in this scope

motor.step(100, FORWARD, SINGLE);

^

sketch_apr04b:18: error: 'BACKWARD' was not declared in this scope

motor.step(100, BACKWARD, SINGLE);

^

sketch_apr04b:20: error: 'DOUBLE' was not declared in this scope

motor.step(100, FORWARD, DOUBLE);

^

sketch_apr04b:23: error: 'INTERLEAVE' was not declared in this scope

motor.step(100, FORWARD, INTERLEAVE);

^

sketch_apr04b:26: error: 'MICROSTEP' was not declared in this scope

motor.step(100, FORWARD, MICROSTEP);

^

exit status 1
'AF_Stepper' does not name a type

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

EX-SQUEEEEZE ME? WHO U TALKIN TO BIG MOUTH FATTY! GUT OFF MAH PAGE

I'm out: you're on your own now.

(I see what you did... you deleted that post. Too late.)

Huh, guess I wasn't clear enough. Let's try:

gfvalvo:

  1. Read instructions at top of forum on how to PROPERLY post questions and code.

  2. Post the COMPLETE error message. Use CODE TAGS for posting both code and error messages.

Honestly does anyone here know what their doing? I thought you were all supposed to be experts, but no one can just fix this damn code???? Either answer the question go away.

fatoumanajmadoctorchicken:
I thought you were all supposed to be experts

It's a forum: nobody is "supposed" to be anything.

And you're rude, so don't expect too much help from anyone.

Got it. I'm going with Option #2. Fix your own "damn code". See ya.

fatoumanajmadoctorchicken:
Honestly does anyone here know what their doing? I thought you were all supposed to be experts, but no one can just fix this damn code???? Either answer the question go away.

Haha, have fun fixing that "damn code" on your own! 2 people on this forum were trying to help you, yet you decided to act like a spoiled 10 year old and demanded help. Well, good luck with that attitude on this forum. Honestly, do you have any idea how to read replies and follow what is asked?

fatoumanajmadoctorchicken:
Honestly does anyone here know what their doing? I thought you were all supposed to be experts, but no one can just fix this damn code???? Either answer the question go away.

I am going to try to help you in the (I believe) short time before the administrators get involved.

What we do here is help you fix your code. We do this a lot. It is fun for us.
We have a fairly steady stream of people asking for help.
Some of them present enough information for us to see their issue and suggest corrections.
Very often, the new user does not present complete information, and we have to ask for better information from them.

If you can reply to questions like that in a friendly way, you will get a lot of help.
I can see that you are having difficulty staying friendly.
You really need to work on that.

If you do still want help, here is what I think you should do.

  1. apologize for the hostility.
  2. provide information that the experienced forum members have asked for

@fatoumanajmadoctorchicken. Will be spending a little time away from the forum, working on revising basic human interactions 101.

I’m new to this thread so missed all the name calling, so Amy prepared to pitch in.

If you haven’t already fixed it (at least) one of the problems is the af_Stepper does not name a type. What this means is the definition of the object is missing. You probably need to “#include <....the name of the library.... .h>”

You can probably download the library from wherever you bought the interface board.

Best regards