Finding location of errors?

I am attempting to get the bender_328 panoboter program to compile and i have made it from 100s of errors to these last 3 and I am stumped as to how i would find the location of the errors in the code. Is there a way for me to make the Arduino software tell me?

I am completely new to this so any pointers would be helpful.

http://openrise.com/lab/bender_328/index.htm?arduino

The IDE highlights the line in your sketch containing the first error.

The number just before the word 'error' is the line number, usually high by one because the IDE adds a line before your sketch.

Look a line 24 for the '&' token. The error says it was expecting something different there.

This is what I find in the main code, I assume the real issue might be in one of the support libraries.

022 // MENU
023
024 #define SPHERE_SIZE 7 // size of sphere list
025 #define MULTIROW_SIZE 10 // size of multirow list
026 #define SETUP_SIZE 6 // size of setup list
027 #define HELPER_SIZE 1 // size of helper list
028 #define DEBOUNCE_TIME 500 // debouncing time for rot button
029

I assume the real issue might be in one of the support libraries.

Comment them out. If the error goes away, then you assumption is credible. Otherwise, it is not. Generally, libraries get pretty thoroughly tested before release, so I doubt that your problem is in a library. Post all of your code, and we'll help you fix it.

nic579:
This is what I find in the main code, I assume the real issue might be in one of the support libraries.

022 // MENU
023
024 #define SPHERE_SIZE 7 // size of sphere list
025 #define MULTIROW_SIZE 10 // size of multirow list
026 #define SETUP_SIZE 6 // size of setup list
027 #define HELPER_SIZE 1 // size of helper list
028 #define DEBOUNCE_TIME 500 // debouncing time for rot button
029

If the problem was in a file other than your sketch the file name would have shown up in the error message.

Try putting the #define lines above the #include lines for libraries to see how the error moves. Or, better yet, try changing them to const ints:

022 // MENU
023
024 const int SPHERE_SIZE = 7; // size of sphere list
025 const int MULTIROW_SIZE = 10; // size of multirow list
026 const int SETUP_SIZE = 6; // size of setup list
027 const int HELPER_SIZE = 1; // size of helper list
028 const int DEBOUNCE_TIME = 500; // debouncing time for rot button
029

Ok but I did just find this which hints to me that it has something to do with EEPROM or possibly not: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1293801796

If I comment out EEPROM it flags the loss of EEPROM and the old errors remain.

Thanks for the info, so as you say, its not in EEPROM code if the errors remain.

Not to beat a dead horse, but:

Post all of your code, and we'll help you fix it.

Here it is but now I get the highlight back.

The request was "Post your code", not "Post a picture of some of your code". Never mind. I no longer want to see your code. Good luck.,

Sorry Paul didn't see your post, Sister Brother+inlaw kids and dogs raided my house. Don't help its all good it is your choice to do whatever you want. Often there is more to learn by beating your head against the wall till something shakes out anyhow.

Interesting info here.

http://code.google.com/p/arduino/issues/detail?id=472

Issue 472: Compilation error using "template " - Arduino IDE 0022

I found an error using the last revision of Arduino IDE (0022).
This code doesn’t compile correctly:

template int SRAM_writeAnything(int ee, const T& value)
{
const byte* p = (const byte*)(const void*)&value;
int i;
for (i = 0; i < sizeof(value); i++)
EEPROM.write(ee++, *p++);
return i;
}

template int SRAM_readAnything(int ee, T& value)
{
byte* p = (byte*)(void*)&value;
int i;
for (i = 0; i < sizeof(value); i++)
*p++ = EEPROM.read(ee++);
return i;
}

The IDE returns this error:
error: expected ‘,’ or ‘…’ before ‘&’ token
error: ISO C++ forbids declaration of ‘T’ with no type
error: ‘T’ has not been declared

Using version 0021 it works fine.

I moved to Arduino 0021 and have gotten a different error set:

C:\arduino-0021\libraries\MemoryFree\MemoryFree.cpp:1: error: stray '\357' in program
C:\arduino-0021\libraries\MemoryFree\MemoryFree.cpp:1: error: stray '\273' in program
C:\arduino-0021\libraries\MemoryFree\MemoryFree.cpp:1: error: stray '\277' in program

nic579:
I moved to Arduino 0021 and have gotten a different error set:

C:\arduino-0021\libraries\MemoryFree\MemoryFree.cpp:1: error: stray '\357' in program
C:\arduino-0021\libraries\MemoryFree\MemoryFree.cpp:1: error: stray '\273' in program
C:\arduino-0021\libraries\MemoryFree\MemoryFree.cpp:1: error: stray '\277' in program

I think that may be due to some not very smart programs (cough microsoft office) like to change quotes into non ASCII fancy quotes.

That error just means that it found weird characters it doesn't understand. Look for them.

I think that may be due to some not very smart programs (cough microsoft office) like to change quotes into non ASCII fancy quotes.

That error just means that it found weird characters it doesn't understand. Look for them.

Thank You!

Note Pad possibly? Or Wordpad actually.

I switched to my LINUX desktop cycled the code through VI and it compiles now.

Should I use Atmel Studio 6 in Windows or is there other software I should be looking at?

If you just want a good programmers editor there are many, I use Notepad++ as do many people. It’s very good.


Rob