This is a script I made for the ESP8266 that uses the Wi-Fi chip and creates a new Access Point every 5 seconds in order to display a message on WiFi lists on nearby devices that looks like this:

[![Wifi list, showing "Never gonna give you up","Never gonna let you down","Never gonna make you cry","Never gonna say goodbye"](https://i.stack.imgur.com/VVahH.jpg)](https://i.stack.imgur.com/VVahH.jpg)

The code is:

```
#include <ESP8266WiFi.h>

const char* ssids[] = {"Never gonna give you up","Never gonna let you down","Never gonna run around","Never gonna make you cry","Never gonna say goodbye","Never gonna tell a lie"};
const char* pass = "pass_goes_here";
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  int currentssidno = 0;
  while (true)
  {
    const char* ssid = ssids[currentssidno];
    Serial.print("SSID: ");
    Serial.println(ssid);
    WiFi.softAP(ssid, pass);
    delay(5000);
    WiFi.softAPdisconnect(false);
    currentssidno = currentssidno + 1;
    if (currentssidno == 6) //please change this count if you change the amount of ssids
    {
      currentssidno = 0;
    }
  }
}

void loop() {
}

```

The code is [also on GitHub](https://github.com/ardaozkal/Rickroll-Wifi).

How can I improve this code? This is my second or third project with Arduino and I pretty much made it in 15 minutes and looking at it now, some parts feels like dirty code (especially the part where I switch reset the SSID counter), how can I improve this?

Extra resources: [Wi-Fi Library](https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266WiFi), [ESP8266 Arduino Core](https://github.com/esp8266/Arduino)