help with code for robot

Hi there I'm new to C++ and I'm having trouble with some code for a small robot I'm building called Magbot which I found in a magazine. IM currently trying to build the final robot but the code that came with the robot reports some errors when I try to verify it in the Arduino IDE. I would be extremely grateful if someone could take a look at the code and possibly provide me with a solution as I've bought all the robot parts and really would like to get it finished. Here are the errors:

Magbot:145: error: 'decode_results' does not name a type
Magbot:151: error: 'IRrecv' does not name a type
Magbot.ino: In function 'void setup()':
Magbot:194: error: 'irrecv' was not declared in this scope
Magbot.ino: In function 'void loop()':
Magbot:240: error: 'irrecv' was not declared in this scope
Magbot:240: error: 'results' was not declared in this scope

The code is too long to paste in here I've tried but could send you it if you needed a look. Many thanks
Hi.
The code is too long to paste in here I've tried but could send you it if you needed a look


I suspect, because of this you are not going to get many replies. If I was you I'd try a bit of general googling. For example I've just googled "c++ does not name a type", and got back a few useful looking hits, e.g.
http://stackoverflow.com/questions/2133250/does-not-name-a-type-error-in-c

"was not declared in this scope" should be fairly easy to fix/spot. I see that it's not happy with "IRrecv" in some cases and "irrecv" in others. Is this perhaps an uppercase/lowercase variable issue?

I've never used arduino IDE, but I've just found this after a quick search:
http://forum.arduino.cc/index.php?topic=47881.0
if you can get syntax highlighting on that may help you a bit.
Last edited on
thanks for your reply. I have solved one problem, I simply needed to add a library to the project containing what was needed. Now I am just left with these errors:

Magbot.ino: In function 'void loop()':
Magbot:240: error: 'results' was not declared in this scope


this piece of code concerned:

void loop()
{

// Check for a new IR code
if (irrecv.decode(&results)) {
// Cet the button name for the received code
irHandleInput(results.value);
// Start receiving codes again
irrecv.resume();
}

// Let the timers do their thing.
timer.run();
actionRun();
snd.update();
}

any ideas will be much appreciated. many thanks
well:
if (irrecv.decode(&results)) {

where is your declaration for your variable results?
Topic archived. No new replies allowed.