two or more data types in declaration of 'ssid'

I’ve this “two or more data types in declaration of ‘ssid’”
In this code :

"#include <WiFi.h>
#include <WiFiClient.h>
#include <WiFiServer.h>
#include <WiFiUdp.h>
#include <WiFiUDP.h>
#include <SPI.h>
WiFiUDP

char ssid = “yourNetwork”; HERE
char pass = “secretPassword”;
int status = WL_IDLE_STATUS;
int packets ;
int port = 0 ;

int Battension = 0;
int Lastpos = 0;
int Msgrecieved = 0;
int pinbat = A0;
int Batt = 0;
int Uneed = 3;
int MotG = 11;
int MotD = 12; "

So, WHY ??
Why here, it doesn’t work but in the exemple, it works ?
I’ve also tried without the and change the " by ’

Main_code.ino (1.95 KB)

The error is at your line 7. Remove that line and the code will compile.

THanks, now it’s works but I’ve got a problem here

void setup() {
pinMode(A0, INPUT);
pinMode(MotG, OUTPUT);
pinMode(MotD, OUTPUT); 

while (status != WL_CONNECTED) {
  
   // Connect to WPA/WPA2 network:
   status = WiFi.begin(ssid, pass);

   // wait 10 seconds for connection:
   delay(10000);
 }

WiFiUdp.begin(port);                          HERE

}
exit status 1
'WiFiUdp' was not declared in this scope

Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. If your browser doesn’t show the posting toolbar then you can just manually add the code tags:

[code]

[color=blue]// your code is here[/color]

[/code]

Using code tags and other important information is explained in the How to use this forum post. Please read it.

Please always do a Tools > Auto Format on your code before posting it. This will make it easier for you to spot bugs and make it easier for us to read. If you’re using the Arduino Web Editor you will not have access to this useful tool but it’s still unacceptable to post poorly formatted code. I recommend you to use the standard IDE instead.

Please remove unnecessary blank lines from your code before posting to the forum. One or two to separate code into logical sections is fine but large spaces for no reason or random blank lines just make for more scrolling when we’re trying to read your code.

When you encounter an error you’ll see a button on the right side of the orange bar “Copy error messages”. Click that button. Paste the error in a message here using code tags (</> button on the forum toolbar).

Thank's you very much to help and to show me how to use this forum.
Thank's a lot

Hyper_PLASMA:

exit status 1

'WiFiUdp' was not declared in this scope

You forgot to create a WiFiUdp object. Add this line at line 7 of your sketch:

WiFiUDP WiFiUdp;

It works, thanks a lot for your help !

You're welcome. I'm glad to hear it's working now. Enjoy!
Per