I not sure, how should I changed the sketch? Sorry.
I changed the sketch: e.g. I 've added a '&' etc.
char Host[30];
bool internet = false;
const char Host_001[]PROGMEM = ("www.google.com");
int pingResult; // RTT of the PING
void setup() {
Serial.begin(115200);
while ((!Serial && millis()< 5000)) {
; // wait for serial port to connect. Needed for native USB port only
}
bool mypingresult = PING(Host_001);
if (mypingresult) {internet= true; Serial.println("o.k.");} else {internet= false;Serial.println("not o.k.");}
}
void loop(){
delay(20000);
}
//***********************************************************************************************
bool PING(char Host) { //
pingResult = 50; // dummy result
if (pingResult >= 0) {
Serial.println(F("output 1"));
return true;
} else {
Serial.println(F("output 2"));
return false;
}
}
I ve got the following error messages:
error: invalid conversion from 'const char*' to 'char' [-fpermissive]
bool mypingresult = PING(Host_001);
initializing argument 1 of 'bool PING(char)' [-fpermissive]
bool PING(char Host) {
Correct pointer type?