Getting "Compiler Timed out or encountered an error" When I compile when declaring cloud function

I am trying to create a cloud function that changes the brightness of LEDs for a project I am doing. When I compile, I get the error Compiler timed out or encountered an error. When I comment out the particle function, all is well. Here is my code.

/*
 * Project SUDSv2
 * Description:
 * Author:
 * Date:
 */

//prototypes
int adjustBrightness(String command);

//Pins
  //Output
int led = D1;
  //Input
int leftInput = D3;
int rightInput = D2;

//variables
int brightness = 255;

// setup() runs once, when the device is first turned on.
void setup() {
  Particle.function("adjustBrightness", adjustBrightness);
  
  Serial.begin(12900);
  Serial.println("Hello Serial!");

  pinMode(led, OUTPUT);
  pinMode(leftInput, INPUT);
  pinMode(rightInput, INPUT);

  analogWrite(led, brightness);
}

// loop() runs over and over again, as quickly as it can execute.
void loop() {
  Serial.printlnf("Brightness: %d, Left: %d, Right: %d", brightness, digitalRead(leftInput), digitalRead(rightInput));
  delay(500);
}

int adjustBrightness(String command){
  if (brightness == command.toInt()) {
    return 0;
  }else{
    brightness = command.toInt();
    analogWrite(led, brightness);
    return 1;
  }
}

The function name (first parameter) is not allowed to be any longer than 12 characters.

How are you building?
If you are using Web IDE, you should hit the SHOW RAW button in the error log to see the respective message. In CLI you’ll see it anyway and Particel Dev is a bit less forthcoming with such info.

This would be the respective message

In Particle.function, name must be 12 characters or less
1 Like