Protoneer / WifiPixels

WifiPixels are a combination of a ESP8266 Wifi unit combined with a NeoPixel(Addressable RGB) LED ring all in one.
http://wiki.protoneer.co.nz/WifiPixels
GNU General Public License v2.0
131 stars 23 forks source link

Save SSID + PW to EEPROM #2

Closed Protoneer closed 9 years ago

Protoneer commented 9 years ago

SSID max 32 char PW max 64 char

Cast SSID int ESP8266WiFiClass::begin(char* ssid, char _passphrase, int32_t channel, uint8t bssid[6]){ return begin((const char) ssid, (const char*) passphrase, channel, bssid); }

bool write_StringEE(int Addr, String input) { char cbuff[input.length()+1];//Finds length of string to make a buffer input.toCharArray(cbuff,input.length()+1);//Converts String into character array return eeprom_write_string(Addr,cbuff);//Saves String }

String read_StringEE(int Addr,int length) { String stemp=""; char cbuff[length]; eeprom_read_string(Addr,cbuff,length); for(int i=0;i<length-1;i++) { stemp.concat(cbuff[i]);//combines characters into a String delay(100); } return stemp; }