IDE 1.5.2 sketches not compatible with IDE 1.6.9

Hi People

I have been using the below sketch for a number of small projects and have modified it over the years to suit but below is the origional. I have since updated to the 1.6.9 IDE as i could not get the INA219 library to work that i needed in the older IDE. I have since discovered that none of the sketches i have built using IDE 1.5.3 now compile without a stack of errors. I have tried every thing i can find on the forum remotely related to this issue but after a number of weeks still cant figure it out. Could someone please give me some advice on at least getting the below sketch to compile.


int buttonPin = 2; int ledPin1 = 13; int ledPin2 = 12; int ledPin3 = 11; int buttonState, lastButtonState, counter = 0;

void setup() { // sets up pin input/output pinMode(buttonPin, INPUT); pinMode(ledPin1, OUTPUT); pinMode(ledPin2, OUTPUT); pinMode(ledPin3, OUTPUT); }

void loop() { // reads a High or Low voltage from button pin (1 or 0) buttonState = digitalRead(buttonPin);

// has button state changed since last reading? if (buttonState != lastButtonState) { if (buttonState == HIGH) { // if button pressed, do something counter++; if (counter > 3) { counter = 1; } lightLED(counter); } else { ledOFF(); } }

// save button state for next reading lastButtonState = buttonState;

// wait 100 milliseconds between readings delay(100); }

void lightLED(int led) {

switch(led) { case 1: digitalWrite(ledPin1, HIGH); break; case 2: digitalWrite(ledPin2, HIGH); break; case 3: digitalWrite(ledPin3, HIGH); break; } }

void ledOFF() {

digitalWrite(ledPin1, LOW); digitalWrite(ledPin2, LOW); digitalWrite(ledPin3, LOW); }

Would you mind sharing the stack of errors? Use code tags please, as the forum software might eat some of the error message code and turn it into smileys 8)

That code compiles fine for me in IDE V1.6.9. As MorganS asks, error messages please?

It also should be between [code]code tags[/code], not posted inline. Perhaps you could edit and fix that?

The newest version is 1.6.10, and your sketch compiled just fine for an Arduino Uno with Arduino IDE 1.6.10.

Sketch uses 1,236 bytes (3%) of program storage space. Maximum is 32,256 bytes. Global variables use 15 bytes (0%) of dynamic memory, leaving 2,033 bytes for local variables. Maximum is 2,048 bytes.

Which Operating System do you use ? Which Arduino boards to you use ? Do you know where the "arduino15" folder is ?

Remove all the old Arduino IDE software, but keep your projects. Delete the "arduino15" folder. Install the Arduino IDE 1.6.10. Perhaps you have to check the user "libraries" folder if there are libraries that are already included with the Arduino IDE.

ADDED: If you are using linux and if you like the -flto option to be set as default, then you can use version 1.6.10. There are issues with it in Windows.

Koepel: Install the Arduino IDE 1.6.10.

IDE V1.6.10 has it's own problems that have been discussed over recent days. It shouldn't be necessary to install it to get the code to compile. IDE V1.6.9 is more stable, when correctly installed.