So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By pablopablo
#80441
torntrousers wrote:
Code: Select all#include <ESP8266WiFi.h>

String ssids[] = { "Apple", "Banana",  "Orange"};
int howManySsids = 3;
 
void setup() {
  WiFi.persistent(false);
  WiFi.mode(WIFI_AP);
}

int i;

void loop() {
  WiFi.softAP(ssids[i++].c_str());
  if (i >= howManySsids) i = 0;
  delay(10000); 
}



Thanks again torntrousers

OK, trying to code this but getting my logic messed up (Can code a bit - but its been a while!)

Code: Select all#include <ESP8266WiFi.h>

String ssids[] = { "Apple", "Banana",  "Orange"};
int howManySsids = 3;
 
void setup() {
  WiFi.persistent(false);
  WiFi.mode(WIFI_AP);
 
}

int i;

void loop() {
  for (i = 0; i<= howManySsids; i++){
  WiFi.softAP(ssids);
  delay(2000);
}
}


Which is returning:

Code: Select allexit status 1
no matching function for call to 'ESP8266WiFiClass::softAP(String [3])'


Any suggestions welcome and thanks for your time.
User avatar
By pablopablo
#80445
torntrousers wrote:You've left out the ssids array index on the WiFi.softAP call, also it seems to need the c_str() call too, i think that could be a bug in the sdk code though so just ignore it and try
Code: Select allWiFi.softAP(ssids[i].c_str());


I actually missed this part of your earlier post..so double kicking myself.