I have an interesting problem. First, if I compile and flash the example program “3pi-linefollower” using the arduino environment and windows-xp, the program works as it should. If I reboot the system under linux and compile and program the “3pi-linefollower” program,(using the same hardware, programmer and arduino version), the program loads but the display fails to display the battery voltage correctly. Other than the incorrect voltage display , the program works as it should. The display shows rapid random characters until the “mV” and flickers; the second line “Press B” is fine (no flickering)
I made sure that the programmer was not the issue by taking the hex file from the windows environment and downloaded it in the linux environment and it behaves as it should.
If I use the avr-gcc environment to compile the program, it works as it should in both windows and linux. Has there been any issues with the OrangutanAnalog functions (readBatterMillivolts) using the Arduino environment? I am using the latest Arduino release (0015). Any further steps that I could take to isolate the cause?
We did actually have a somewhat similar report of problems with the battery voltage display under Arduino and avr-gcc - see the thread here. I’ve never personally seen these random characters, and I’d really like to get to the bottom of this.
I’m a little confused, first of all, about what you are actually trying to compile. The 3pi-linefollower example is a C example without an Arduino .pde file. Are you somehow compiling that, or are you using one of the Arduino examples?
Next, what version of GCC do you have installed under linux? Can you try simplifying it down to an extremely simple program displaying “5000mV” over and over again in a loop, using the same print function as whatever Arduino code you are using, to make the smallest possible program that doesn’t work for you?
Then, if that doesn’t reveal the bug, we should be able to figure it out by trying various versions and comparing the results at various levels of compilation.
Sorry for the confusion… I am using the “Simple3piLineFollower.pde” example under the arduino Pololu3pi examples. Basically, the windows arduino environment works but not the linux environment. The gcc version is:
gcc (Ubuntu 4.3.2-1ubuntu12) 4.3.2
I’ll write some test code and let you know what I find out.
I migrated my Linux system to Fedora 10 to update the avr-gcc and avrdude packages. Since I needed to get a a system on to Fedora 10, I figured I also have a reason to try the latest
Anyway, going to avr-gcc 4.3.3, avrdude 5.5, I no longer see any issues. I believe the compiler is to blame, however. I was using avr-gcc 4.3.