I'm sorry if this is a very simple question but this has been driving me nuts!!
I've been using Arduino 0011 with no problem. I just downloaded version 0012.
When I compile using 0012 DC_Motor, including AFMotor I get the following error:
Hardware\Libraries\AFMotor.h: 63: error: expected ')' before 'motornum'. ![]()
I do not get this error running 0011.
I believe both versions are using the same DC_Motor sketch. But each is calling #include <AFMotor.h> from its individual files “Hardware\Libraries\”. So I checked each AFMotor.h and they are identical.
Why would I get an error with version 0012 and not with 0011?
try adding these two lines to AFMotor.h
#include <inttypes.h>
#include <avr/io.h>
The beginning of the file should now look like this:
#ifndef AFMotor_h
#define AFMotor_h
#include <inttypes.h>
#include <avr/io.h>
mem,
Thanks for your reply. What you suggested took care of that problem but brought in two more.
The new ones are: "'CS01' was not declaired in this scope" and the second is "'_BV' was not declaired in this scope"
This really brings up other questions. First, understand that I haven't done any programming since college Fortran days about 400 years ago
Is there a simple reason why this would work in version 011 and not in 0012? Am I the only one having this problem?
Again thank you for helping this very old newbe.
These errors are for missing constants and macros that are defined in various AVR header files. These definitions have probably been moved around in the version of the compiler provided with 0012.
CSxx (various timer constants ) should be brought in with the #include <avr/io.h>
_BV is a macro that gets a bit value.
Anyway, I tried the mod I suggested on my system with 0012 and the laydada test sketch compiles ok. Perhaps post a question in the ladyada forum. My guess is that this is a compatability issue between the latest version of the AVR GCC compiler and the library you are using, I don't think its an issue with arduino specific code.
Thanks mem