Go Down

Topic: bug in version 1.9.0 (Read 890 times) previous topic - next topic

speedylearner

Hello,
dunno if this is the right section to signal this bug...
In version 1.9.0, when I get some error such as "irrecv is not declared", the line highlighted in red is always the wrong one; it higlights the } at the end of the section with the wrong line.
In previous versions (1.8.5) it did not do such a thing.
This is a minor bug and not important, but it could be an inconvenience with big codes.
Thanks

pert

No, this is not the right section. I'd say "Suggestions for the Arduino Project" would be the most appropriate. I've requested that it be moved there.

Which build of 1.9.0 are you using (it will be shown in the folder name)?

Please provide a minimal complete demonstration sketch that can be used to reproduce the issue.

speedylearner

Thank you,
I think the build is 1.8.6... It is the only version number shown in the folder name...
this the right code:
Code: [Select]
#include <LiquidCrystal.h>
#include <IRremote.h>
#include <Servo.h>
#include <SimpleDHT.h>

const int pin = A0; // analog pin for the temp sensor
float celsius = 0; //all for the thermometer
float millivolts; //all for the thermometer
int sensor; //all for the thermometer
const long TemperatureInterval = 1000; //all for the thermometer
unsigned long TemperaturePreviousMillis = 0;  //come sopra
const long IRreceiverInterval = 1;
unsigned long IRreceiverPreviousMillis = 0;
const long DHT11Interval = 75;
unsigned long DHT11PreviousMillis = 0;
const long lightSensorInterval = 75;
unsigned long lightSensorPreviousMillis = 0;
int firstRoomLed = 2; //lights
int secondRoomLed = 3;
int thirdRoomLed = 4;
int fourthRoomLed = 5;
int fifthRoomLed = 6;
int receiver = 7;  // IR receiver?
int pinDHT11 = 22;
int light;
IRrecv totalController(receiver);     
decode_results results;   
LiquidCrystal lcd1 (8, 9, 10, 11, 12, 13);
//LiquidCrystal lcd2 (14, 15, 16, 17, 18, 19);
SimpleDHT11 dht11;
Servo door;
Servo washer;
Servo gate;

//54 pin + 20 analog

void setup() {
  Serial.begin(9600); // start serial communication
  door.attach(23);
  washer.attach(24);
  gate.attach(25);
  Serial.println("Press on the remote controller:");
  Serial.println("1 = turn on first light");
  Serial.println("2 = turn on second light");
  Serial.println("3 = turn on third light");
  Serial.println("4 = turn on fourth light");
  Serial.println("5 = turn on fifth light");
  Serial.println("6 = open the gate");
  Serial.println("7 = show clock on LCD screen");
  totalController.enableIRIn();//IR receiver
  lcd1.begin(16, 2);//LCD screen
  lcd1.clear();
  //lcd2.begin(16, 2);//LCD screen
  //lcd2.clear();
}

void loop() {
  byte temperature = 0;
  byte humidity = 0;
  byte data[40] = {0};
  unsigned long TemperatureCurrentMillis = millis();
  unsigned long IRreceiverCurrentMillis = millis();
  unsigned long DHT11CurrentMillis = millis();
  unsigned long lightSensorCurrentMillis = millis();
  lcd1.begin(16, 2);
  lcd1.clear();
  //lcd2.begin(16, 2);
  //lcd2.clear();
  if (TemperatureCurrentMillis - TemperaturePreviousMillis >= TemperatureInterval) {
    TemperaturePreviousMillis = TemperatureCurrentMillis;
    int aRead = 0;
    aRead = analogRead(pin);
    Serial.print("Analog = ");
    Serial.print(aRead);
    float tempC = aRead * 0.48875; // convert in centigrades
    Serial.print("     Temp = ");
    Serial.println(tempC);
    lcd1.print("Temp = ");
    lcd1.print(tempC);
    lcd1.print("ยบ C");
  }
  if (IRreceiverCurrentMillis - IRreceiverPreviousMillis >= IRreceiverInterval) {
    if (totalController.decode(&results))  { // have we received an IR signal?
      Serial.println(results.value);
      totalController.resume(); // receive the next value
      delay(1);
    }
  }
  if (DHT11CurrentMillis - DHT11PreviousMillis >= DHT11Interval) {
    if (dht11.read(pinDHT11, &temperature, &humidity, data)) {
      return;
    }
    Serial.print(" ");
    for (int i = 0; i < 40; i++) {
      Serial.print((int)data[i]);
      lcd1.print((int)data[i]);
      if (i > 0 && ((i + 1) % 4) == 0) {
        Serial.print(' ');
        lcd1.print(' ');
      }
    }
    Serial.println("");
 
  Serial.print("Misurations: ");
  Serial.print((int)temperature);
  Serial.print(" *C, ");
  Serial.print((int)humidity);
  Serial.println(" %");
 
  lcd1.clear();
  lcd1.setCursor(0, 0);
  lcd1.print((int)temperature);
  lcd1.print(" *C, ");
  lcd1.setCursor(0, 1);
  lcd1.print((int)humidity);
  lcd1.println(" %");
 
  // DHT11 sampling rate is 1HZ.
  delay(1000);
  }
  if (lightSensorCurrentMillis - lightSensorPreviousMillis >= lightSensorInterval) {
   
  }
}


If I change the variable "TemperatureCurrentMillis" in Loop, the highlighted line is the 25th (the }).
Thanks!

pert

That sketch compiles without any error for me.

I think the build is 1.8.6... It is the only version number shown in the folder name...
Please download the latest beta version of the Arduino IDE from:
https://www.arduino.cc/en/Main/Software#beta
and verify the issue still occurs.

Go Up