Hi,
I've been using the standard stepper library as supplied as part of arduino 0022 and have come back to some code that was working previously but that now will not compile - the error seems to be related to the math.h library but I am uncertain as to why this error suddenly occured as the library was working previously.
I'm trying to drive a stepper using the library and not doing anything too unusual I think.
Any advice much appreciated...
I'm using a Macbook Pro with OS x 10.5.8 and Duemilanove
The code is copied below and the error is:
In file included from /Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/WProgram.h:6,
from stepper_library_test.cpp:4:
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/include/math.h:439: error: expected unqualified-id before 'double'
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/include/math.h:439: error: expected )' before 'double' /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/include/math.h:439: error: expected )' before 'double'
#include <Stepper.h>
Stepper bigstepper (200, 4,6,5,7); // 200 step stepper 1.8deg
// note the pin order is not normal
// 4 red, 5 green, 6 black, 7 yellow
// for R S191 - 8356 Motor
void setup()
{
//bigstepper.setSpeed(6); // 6 RPM
}void loop()
{
bigstepper.setSpeed(6); // 6 rpm
bigstepper.step(200); //no of steps
delay (500);
bigstepper.setSpeed(25); //25 rpm
bigstepper.step(-200); // no of steps backwards
delay (200);}