i am trying to write some motor control codes and keep getting stopped. It seems like a simple issue but I cannot seem to get past it.
I have a code that I got and it verified ok. So I am using it as a guide and my work is below and for some reason I am getting the error; 'AR_DCMotor' does not name a type and it repeats for motor 2. Then the error ;'motor1' was not declared in this scope and that repeats for motor2. Why in one sketch the wording is ok but in another it is not ok? I have tried using parenthsis and still errors. Codes seem to be my biggest problem. Thanks for your help Charlie J
As franklin says, that error typically means that the library is not installed in the correct location. Our library tutorial explains how to install libraries: http://www.ladyada.net/library/arduino/libraries.html
I am thinking that one motor code that was downloaded from another source verifies and works my motor shield, the proper files are in my computer? So if I enter my codes why do they not work, I have been on this road before, I did not like it. I have checked my computer and the motor files are in the library files and are properly renamed. ?? Charlie J
The best I can tell the files are correct; arduino-1.0.1\libraries\AFMotor is the line when I go to the file. In the file I see AFMotor.ccp and AFMotor.h files. But I entered #include <AF_Motor> it did not compile and gave me a long error message
core.a(main.ccp.o):In function 'main':
F:\arduino-1.0.1\hardware\arduino\cores\
arduino/main.cpp:11:undefined reference to 'setup'
F:\arduino-1.0.1\hardware\arduino\cores\arduino/main.cpp:14undefined reference to 'loop'
Yet when I compile a code from your website it verifies ok Again what am I doing wrong? Charlie J
Undefined references to loop and setup are a different animal. You may have a stray or missing curly bracket someplace. Post your code, and we'll have a look
F:\arduino-1.0.1\hardware\arduino\cores\
arduino/main.cpp:11:undefined reference to 'setup'
F:\arduino-1.0.1\hardware\arduino\cores\arduino/main.cpp:14undefined reference to 'loop'
I am home and reexamined my library, I looked at your folder page and mine is much the same, starts arduino-1.0.1; under that is other files (drivers; examples; hardware; java; lib; library) In the library is AFMotor and in the file is examples; AFMotor.ccp; AFMotor.h ; keywords; Readme. With the other files it is the same.
I entered a simple code to drive the motors forward and it did not verify Here is my code;
#include<AF_Motor.h>
In your last post you asked for the error codes, I can copy the control codes but I cannot seem to copy the error codes. I have tried copy and paste and copy to forum and niether works. How can I di that? Charlie J