Go Down

Topic: IDE 1.6.7 Released (Read 5391 times) previous topic - next topic

dzfan

I notice that the compiler takes longer even if you didn't change any code. 

I just upgraded from 1.6.4 to 1.6.7, and I remember that one of the improvements in 1.6.4 was that when you recompiled, it would re-use pre-compiled files if they hadn't changed.  Now it seems to take longer no matter what.

Is there any improvement in sight?  I really appreciated that fast re-compile if I only changed one line of code.

ZvikaRozenshein

When was the WIRE library modified?

I am using LiquidCrystal_I2C library. it was working fine from versions 1.0.5 until version 1.6.0
in version 1.6.7 it is not working!

any idea why?

pert

When was the WIRE library modified?
Arduino IDE 1.6.6
I am using LiquidCrystal_I2C library. it was working fine from versions 1.0.5 until version 1.6.0
in version 1.6.7 it is not working!

any idea why?
Because of the change to the Wire library. The library has been fixed but the author has not made a release since the fix was merged so the fix is not available via Arduino IDE Library Manager. You will need to download the library from https://github.com/marcoschwartz/LiquidCrystal_I2C and install it from the downloaded zip file. If you need help doing this I can give instructions.

pieman

I 'upgraded' from 1.6.5. to 1.6.7 and seriously regretting it.

Has the order of functions become important between 1.6.5 and 1.6.7?

All my functions are coming up as 'not declared in this scope' when I try to compile my sketch.

If the ordering is not important is there a new way to define functions from:

void somefunction()
{

  int x++;

}

and calling them as:

somefunction();
Look up our website url on our profile page to find out more about the Arduino based Combined RF Boiler Control and RF Learner.

pert

Has the order of functions become important between 1.6.5 and 1.6.7?

All my functions are coming up as 'not declared in this scope' when I try to compile my sketch.
What has happened is that since Arduino IDE 1.6.6 they are using a new system, arduino-builder, to automatically generate function prototypes but unfortunately it frequently fails to do things that the old system did just fine.

So in general a better solution than trying to get the function definitions in the right order(which might be impossible in some cases) is to manually declare your function prototypes. So in your example you would add the line
Code: [Select]
void somefunction();
Outside of any function and above the first call to the function.

If you will post examples of the code you are having this problem with I'll look at it and see if there are specific solutions for that code. It's possible some problems have already been fixed or if they are not already known I can submit an issue report and we can hope they will eventually get around to fixing this thing.

pieman

Specifically the issue with functions appears to start with SimpleTimer commands such as the following in setup():

timer.setInterval(30000L, getTemperature);  // check temperature every 30 seconds

Previously I had getTemperature function a long way after setup() and it compiled with 1.6.5. but not 1.6.7.
If I move the function, and any functions it calls within the function, BEFORE setup() then the sketch compiles with 1.6.7.

Strange?
Look up our website url on our profile page to find out more about the Arduino based Combined RF Boiler Control and RF Learner.

pert

Specifically the issue with functions appears to start with SimpleTimer commands
Please post a link to where you downloaded the SimpleTimer library. I'm finding multiple different sources and don't know if they're different.

pieman

#67
Feb 07, 2016, 11:22 pm Last Edit: Feb 07, 2016, 11:37 pm by pieman
Thanks for your reply pert.

My sketch now compiles having moved the 4 functions called with 4 SimpleTimer's to before the setup() but I also had to move some of the functions that were called in those functions before setup().

I was starting to get worried about the 'impossible' task that you refer to of circular functions but it looks ok at the moment.

My version of SimpleTimer came from the Blynk github as they strongly recommend it. I actually did a file comparison to be sure it matches the 'official' one as some Blynk users were having problems. The files matched and I suspect the problems they were having were not that they hadn't installed the libraries correctly (as we suspected) but the new arduino-builder that you refer to.

The version of SimpleTimer that Blynk provides matches this one https://github.com/jfturcot/SimpleTimer
Look up our website url on our profile page to find out more about the Arduino based Combined RF Boiler Control and RF Learner.

pert

I just tried the example http://playground.arduino.cc/Code/SimpleTimer?action=sourceblock&num=1 with the function definitions moved to after the timer.setInterval() calls with 1.6.7 and it didn't have the problem so I would need some example code that demonstrates the problem you're encountering to be sure but it might be related to this issue: https://github.com/arduino/arduino-builder/issues/50.

pieman

Below is an extract of the sketch and all the functions before setup() were previously working ok after setup().

Code: [Select]
void checkBlynk(){

  bool isconnected = Blynk.connected();
  if (isconnected == false){
    disconnects++;     
  }
  if(disconnects > 0){
    Blynk.virtualWrite(V11, 255);
  }
}

void NEWtransmitFixedCode() {

  int deviceFixedAction[28] = {28, 18, 15, 15, 32, 15, 32, 15, 32, 15, 32, 15, 32, 32, 15, 15, 32, 15, 32, 32, 15, 15, 32, 32, 15, 32, 15, 213}; // FixedAction array for OFF
  if (CentralHeating == 1) {
    deviceFixedAction[24] = 32;
    deviceFixedAction[23] = 15;
    deviceFixedAction[22] = 15;
    deviceFixedAction[21] = 32;  // only these 4 array items need changing for OFF to become ON
  }
  rfsignal = deviceFixedAction[0];
  int repeats = deviceFixedAction[1];
  //The signal is transmitted several times in succession - this may vary with your remote, repeats holds this variable.
  for (int j = 0; j < repeats; j++) {
    for (int i = 2; i < rfsignal; i = i + 2) { // signal starts at position 2 in the array, 0 is overall size of the array, 1 is the number of repeats
      //digitalWrite(rfTransmitPin, HIGH);   // Transmit a HIGH signal
      digitalWrite(4, HIGH);   // Transmit a HIGH signal 4 is GPIO 5 on my ESP
      delayMicroseconds(deviceFixedAction[i]*timeDelay);
      //digitalWrite(rfTransmitPin, LOW); // Transmit a LOW signal
      digitalWrite(4, LOW); // Transmit a LOW signal 4 is GPIO 5 on my ESP
      delayMicroseconds(deviceFixedAction[i + 1]*timeDelay);
    }
  }
}

void DeviceOff() {   // details for heating off
  Serial.println("Device OFF");
  lcd.print(0, 0, "OFF");
  Blynk.virtualWrite(V2, 0);
  //digitalWrite(GreenLED, LOW); // turn LED OFF
  CentralHeating = 0;
  NEWtransmitFixedCode();
}

String intsize(int testvalue) { // 0 to 1440 for time in minutes
  if (testvalue > 999) {
    ThePrefix = "";
  }
  else if (testvalue > 99) {
    ThePrefix = " ";
  }
  else if (testvalue > 9) {
    ThePrefix = "  ";
  }
  else {
    ThePrefix = "   ";
  }
  return ThePrefix;
}

String intsizetemp(int testvalue) { // negatives for temperature to -99 degrees
  if (testvalue > 9) {
    ThePrefix = " ";
  }
  else if (testvalue < -9) {
    ThePrefix = "";
  }
  else if (testvalue < 0) {
    ThePrefix = " ";
  }
  else {
    ThePrefix = "  ";
  }
  return ThePrefix;
}

void refreshLCD() {  // every 7 seconds
  if (FirstPass == 0){   // try to get temperature as quickly as possible
    DS18B20.requestTemperatures();
    temp = (((DS18B20.getTempCByIndex(0) * Calibrate) * 1) + 50) / 100; // 50 is for rounding
    delay(100);  // can take up to 1 second to read temperature chip
  }   
  if (Mode != 3){
    if (CentralHeating == 0) { // using CentralHeating == 0 / 1 for all modes, still to code up
      lcd.print(0, 0, "OFF ");
    }
    else {
      lcd.print(0, 0, "ON  ");
    }
    if (Mode == 0) {
      lcd.print(4, 0, "MANUAL  ");
    } 
    if (Mode == 1) {
      lcd.print(4, 0, "TIMER  ");
    }
    if (Mode == 2) {
      lcd.print(4, 0, "FIXED  ");
    }
    if (Mode > 3){   // 4 and 5 are Thermostatic mode
      lcd.print(4, 0, "THERMO "); 
    }
    testvalue = temp;
    intsizetemp(testvalue);
    CurrentTemp = ThePrefix + temp + TempSuffix;  // don't refresh temperature sensor just display last reading
    lcd.print(11, 0, CurrentTemp); // display temperature on line 0 from character 11
  }
  if (Mode < 2) {             
      testvalue = CountdownTime;
      intsize(testvalue);
      CurrentTime = ThePrefix + CountdownTime + " MINUTE(S)  ";  // needed to ensure string is correct
      // row above converts integer time to a string and add prefix and suffix to string
      lcd.print(0, 1, CurrentTime);
  }
  if (FirstPass == 0){   // ensure all buttons and LED's are set as off on bootup
    FirstPass++;
    Blynk.virtualWrite(V0, 0);   // Timer button
    Blynk.virtualWrite(V2, 0);   // Greem LED
    Blynk.virtualWrite(V3, 0);   // Yellow LED
    Blynk.virtualWrite(V6, 0);   // Manual button
    Blynk.virtualWrite(V11, 0);  // Red LED
    Blynk.virtualWrite(V14, 0);  // Thermo button
    DeviceOff();  // turn off device on bootup
  }
}



void DeviceOn() {  // details for heating on
  Serial.println("Device ON");
  lcd.print(0, 0, "ON ");
  Blynk.virtualWrite(V2, 255);
  Blynk.virtualWrite(V3, 255); 
  //digitalWrite(GreenLED, HIGH); // turn LED ON
  CentralHeating = 1;
  NEWtransmitFixedCode();
}



void displaylcd() {
  testvalue = CountdownTime;
  intsize(testvalue);  // determines number of digits in the integer
  CurrentTime = ThePrefix + CountdownTime;
  lcd.print(0, 1, CurrentTime);
}

void CheckTimerThermo()   // every 60 seconds check if timer is still running AND if check THERMO mode
{
  if (TimerStarted == 1) {
    CountdownTime--;
    if (CountdownTime == 0){
      TimerStarted = 0;
      Mode = 0;
      Blynk.virtualWrite(V0, 0);
      lcd.print(0, 4, "MANUAL ");
      DeviceOff();
    }
    displaylcd(); 
  }
  if(Mode > 3){
    if (temp >= TooHot){
       DeviceOff();   // Send OFF signal
       lcd.print(0, 1, " HOT ENOUGH OFF ");
    }
    if ((temp < TooCold) || (temp < TooHot)){
       if(CentralHeating == 0){
         DeviceOn();   // Send ON signal
       }
       lcd.print(0, 1, " TOO COLD SO ON ");
    }
  }
}


void getTemperature() {

  DS18B20.requestTemperatures();
  temp = (((DS18B20.getTempCByIndex(0) * Calibrate) * 1) + 50) / 100; // 50 is for rounding
  delay(100);  // can take upto 1 second to read temperature chip
  Serial.print("\nTemperature is now ");
  Serial.print(temp);
  Serial.println(" deg C");   // ºC");
  testvalue = temp;
  intsizetemp(testvalue);
  CurrentTemp = ThePrefix + temp + TempSuffix;
  if (Mode < 3){
    lcd.print(11, 0, CurrentTemp); // display temperature on line 0 from character 11
  }
}

void GetMaxMinString(){
    testvalue = TooCold;
    intsizetemp(testvalue);
    MinTemp = ThePrefix + TooCold;
    testvalue = TooHot;
    intsizetemp(testvalue);
    MaxTemp = ThePrefix + TooHot;
    MaxMinString = MinTemp + " TO" + MaxTemp + " ºC    "; 
}

void setup()
{
  // setup GPIO pins
  pinMode(motionPin, INPUT);  // 5   4 and 5 are mixed up on ESP so this is GPIO 4
  pinMode(rfTransmitPin, OUTPUT);   //Transmit pin is an output
 
  Serial.begin(9600); // See the connection status in Serial Monitor
 
  DS18B20.begin();  // setup OneWire bus
 
  Blynk.begin(auth, "GargoyleTest", "19651965AB"); //insert here your SSID and password

  timer.setInterval(60000L, CheckTimerThermo);  // check Timer and Thermo every 60 seconds(EVERY MINUTE)
  timer.setInterval(30000L, getTemperature);  // check temperature every 30 seconds
  timer.setInterval(7000L, refreshLCD); // refresh LCD if needed every 7 seconds
  timer.setInterval(3000L, checkBlynk); // check if connected to Blynk server every 3 seconds


}


Google paid several billion dollars for code that does the same as our sketch when they bought Nest a few years ago  :)
Look up our website url on our profile page to find out more about the Arduino based Combined RF Boiler Control and RF Learner.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy