Is these code wrong? (Oh my god,please help me. ToT)

In this page : Using DC Motors | Adafruit Motor Shield | Adafruit Learning System

I found some code which claimed that they can control the running direction of a DC motor though a motor shield.

However,when I put them into Arduino and verify them.

Arduino said there are some error:

So,is these code wrong?

Or,they can work to control the running direction of a DC motor though a motor shield?

Please,someone,please help me. =(

You have installed the AFMotor library? In the right place? And restarted the Arduino software?

Did you install the AFMotor.h library?

edit.... Jeez, you have to be quick off the mark here!

We can't test your code since you didn't post it the correct way. Please read the two posts by Nick Gammon about the proper way to use this Forum. You will get a lot more responses posting in the proper manner.

When I tried to compile without having installed the library, I got that exact error, btw.

MarkT:
You have installed the AFMotor library? In the right place? And restarted the Arduino software?

JimboZA:
Did you install the AFMotor.h library?

edit.... Jeez, you have to be quick off the mark here!

JimboZA:
When I tried to compile without having installed the library, I got that exact error, btw.

OH MY GOD! :astonished: :astonished: :astonished: :astonished:

You guys are so clever!

What I am need is exactly the AFMotor.h library!

After I have installed it,there is no error anymore!

Excellent!

Thank you very much!