Getting error while declaring a char variable in arduino-IDE

Viewed 18

I am trying to program ESP8266-Wifi module through Arduino-IDE. I am having an error in the following code snippet, any help would be much appreciated.

// Import required libraries
#include <ESP8266WiFi.h>
// WiFi parameters
constchar* ssid = "your_wifi_name";
constchar* password = "your_wifi_password";

void setup(void)
{
 // Start Serial
 Serial.begin(115200);
 // Connect to WiFi
 WiFi.begin(ssid, password);

 while (WiFi.status() != WL_CONNECTED) {
 delay(500);
 Serial.print(".");
 }

 Serial.println("");
 Serial.println("WiFi connected");
 // Print the IP address
 Serial.println(WiFi.localIP());
}

void loop() {
}

below you'd find the error which is given by my arduino IDE version 1.8.18:

BLICNKLED01:4:1: error: 'constchar' does not name a type; did you mean 'conststr'?
4 | constchar* ssid = "your_wifi_name";
  | ^~~~~~~~~
  | conststr
BLICNKLED01:5:1: error: 'constchar' does not name a type; did you mean 'conststr'?
5 | constchar* password = "your_wifi_password";
  | ^~~~~~~~~
  | conststr
C:\Users\Admin\Documents\Arduino\z1\BLICNKLED01\BLICNKLED01.ino: In function 'void setup()':
BLICNKLED01:11:12: error: 'ssid' was not declared in this scope
11 | WiFi.begin(ssid, password);
  |            ^~~~
BLICNKLED01:11:18: error: 'password' was not declared in this scope
11 | WiFi.begin(ssid, password);
  |                  ^~~~~~~~
exit status 1
'constchar' does not name a type; did you mean 'conststr'?
0 Answers
Related