Compiling error

I get the following error when compiling

/run/arduino/sketches/Get_Started_feb05a/Get_Started_feb05a.ino: In function 'void onWifiChange()':
/run/arduino/sketches/Get_Started_feb05a/Get_Started_feb05a.ino:107:13: error: expected primary-expression before ']' token
wifi=SSID[]// Add your code here to act upon Wifi change
^
Multiple libraries were found for "WiFiClientSecure.h"
Used: /run/arduino/custom-libraries/WiFiClientSecure for esp32
Not used: /run/arduino/directories-data/internal/Seeed_Arduino_rpcWiFi_1.1.0_a93a349668c69c81
Not used: /run/arduino/directories-data/packages/arduino/hardware/esp32/2.0.13/libraries/WiFiClientSecure
Multiple libraries were found for "WiFi.h"
Used: /run/arduino/directories-data/packages/arduino/hardware/esp32/2.0.13/libraries/WiFi
Not used: /run/arduino/directories-data/internal/VEGA_WiFiNINA_1.0.1_ab2db6059607e9f4
Not used: /run/arduino/directories-data/internal/WiFiEspAT_1.5.0_5169a7bcde168205
Not used: /run/arduino/directories-data/internal/BetterWiFiNINA_1.4.1_f1b425a2b2caf410
Not used: /run/arduino/directories-data/internal/WiFi_1.2.7_c357666d3257ae8a
Not used: /run/arduino/directories-data/internal/NINA-Wi-Fi_1.0.1_8b5f9e1dc71eca55
Not used: /run/arduino/directories-data/internal/Seeed_Arduino_rpcWiFi_1.1.0_a93a349668c69c81
Not used: /run/arduino/directories-data/internal/WiFiNINA_1.9.0_14125145f1e94a79
Not used: /run/arduino/directories-data/internal/DA16200_Wi-Fi_Library_for_Arduino_1.1.0_9d156d307009fe30
Not used: /run/arduino/directories-data/internal/indhilib_3.0.5_645ae16078e566f4

<code>
/* 
  Sketch generated by the Arduino IoT Cloud Thing "Cloud Blink"
  
  Arduino IoT Cloud Variables description

  The following variables are automatically generated and updated when changes are made to the Thing

  String wifi;
  int speed;
  bool led;
  bool mode;
  bool power;

  Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
  which are called when their values are changed from the Dashboard.
  These functions are generated with the Thing and added at the end of this sketch.
*/

#include "thingProperties.h"

void setup() {
  // Initialize serial and wait for port to open:
  Serial.begin(9600);
  // This delay gives the chance to wait for a Serial Monitor without blocking if none is found
  delay(1500); 

  // Defined in thingProperties.h
  initProperties();

  // Connect to Arduino IoT Cloud
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  
  /*
     The following function allows you to obtain more information
     related to the state of network and IoT Cloud connection and errors
     the higher number the more granular information you’ll get.
     The default is 0 (only errors).
     Maximum is 4
 */
  setDebugMessageLevel(2);
  ArduinoCloud.printDebugInfo();
  pinMode(LED_BUILTIN, OUTPUT);
}

int _lastToggleMillis = millis();

void loop() {
  ArduinoCloud.update();
  if (power) {
    if (mode) {
      if (millis() - _lastToggleMillis > speed) {
        led = !led;
        _lastToggleMillis = millis();
      }
    } else {
      led = true;
    }
  } else {
    led = false;
  }
  digitalWrite(LED_BUILTIN, led);
}

/*
  Since Led is READ_WRITE variable, onLedChange() is
  executed every time a new value is received from IoT Cloud.
*/
void onLedChange()  {
  Serial.print("Led status changed:");
  Serial.println(led);
}

/*
  Since Power is READ_WRITE variable, onPowerChange() is
  executed every time a new value is received from IoT Cloud.
*/
void onPowerChange()  {
  Serial.print("Power changed:");
  Serial.println(led);
}

/*
  Since Mode is READ_WRITE variable, onModeChange() is
  executed every time a new value is received from IoT Cloud.
*/
void onModeChange()  {
  Serial.print("Mode changed:");
  Serial.println(mode);
}

/*
  Since Speed is READ_WRITE variable, onSpeedChange() is
  executed every time a new value is received from IoT Cloud.
*/
void onSpeedChange()  {
  Serial.print("Speed changed:");
  Serial.println(speed);
}


/*
  Since Wifi is READ_WRITE variable, onWifiChange() is
  executed every time a new value is received from IoT Cloud.
*/
void onWifiChange()  {
  wifi=SSID[]// Add your code here to act upon Wifi change
}
<code/>

This is not a valid line of code, as the comment suggests. Replace it with one or more valid lines of code that do something useful.

Your topic does not indicate an issue with IDE 2.x and hence has been moved to a more suitable location on the forum.

In future, please mention the board that you are compiling for.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.