I think you may have left off a closing comment here:
/*The level value is from -1 to +1 and represents the duty cycle to be sent to the motor. Converting to radians helps us stay within these limits >>>*/<<<
I think you may have left off a closing comment here:
/*The level value is from -1 to +1 and represents the duty cycle to be sent to the motor. Converting to radians helps us stay within these limits >>>*/<<<
You most likely have the wrong MCU specified for your build. While DDRA exists on the ATmega1280 on an Arduino Mega, DDRA does not exist on the ATmega328 of a regular Arduino.
If you're using the Arduino UI, go to Tools | Board and choose Arduino Mega.
If you're using your own build system, you'll need to update the value that you specify for -mmcu= on the gcc command line.
When the compiler tells you that something "was not declared in this scope," as yourself this question:
What scope was is declared in?
If you can't answer that question, then you've discovered the problem. After all, if you don't know what that name refers to, how can you expect the compiler to? Remember that you are the expert on any code you write.
If you can determine what scope the thing is declared in, then the next task is to determine how that scope relates to the scope you're trying to use it in. Typical problems include (but are not limited to) the following:
::
scope-resolution operator to give a fully qualified name.If you can't find what scope it was declared in, then there are a few things that might be wrong:
#include
directive. This is probably the problem in your case.Hi,
Why not have a look at the arduino code here for a self balancing arduino robot.
The skateboard is very similar in principle. I had not even heard of Arduno when I built the skateboard otherwise I would probably have used one, the learning curve would have been much faster.
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1225283209
John
Hi again,
Here is a link to reasonably straightforward Arduino code for control of a DIY Segway.
This would be a better starting point for your skateboard I think.
http://diysegway.blogspot.com/
Best wishes
John