Skip to content

OSX Function not declared in this scope error message #4843

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rickspratt opened this issue Apr 10, 2016 · 2 comments
Closed

OSX Function not declared in this scope error message #4843

rickspratt opened this issue Apr 10, 2016 · 2 comments

Comments

@rickspratt
Copy link

The following code produces the error "'HSBtoRGB' was not declared in this scope". This appears to only happen in a OS X environment. This error occurs in 1.6.7, haven't tested it any other version of the Arduino IDE. The code will work if you remove the newline from the parameter list in the Function declaration.

int r,g,b,hue,brightness,saturation;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
hue = 180;
brightness = 255;
saturation = 55;

HSBtoRGB(hue, saturation, brightness, &r, &g, &b);

    Serial.print(" hue=");
    Serial.print(hue);
    Serial.print(" saturation=");
    Serial.print(saturation);
    Serial.print(" brightness=");
    Serial.print(brightness);
    Serial.print(" red=");
    Serial.print(r);
    Serial.print(" green=");
    Serial.print(g);
    Serial.print(" blue=");
    Serial.print(b);
    Serial.println("");
    delay(500);

}

void HSBtoRGB(int inHue, int inSaturation, 
int inBrightness, int *oR, int *oG, int *oB ) {

  *oR = inHue;
  *oG = inSaturation;
  *oB = inBrightness;
}
@per1234
Copy link
Collaborator

per1234 commented Apr 11, 2016

Please test using the hourly build http://www.arduino.cc/en/Main/Software#hourly. This appears to be a duplicate of arduino/arduino-builder#80 which was fixed by arduino/arduino-builder@fbfaa56.

I get the same error with Arduino IDE 1.6.7 and 1.6.8 on Windows 7 so I don't think it's OSX specific. The code compiles without error for me using the hourly build.

@facchinm
Copy link
Member

Thanks @per1234 , the issue with multiline declaration has been solved in mainline and will be available with IDE 1.6.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants