I am trying to use EEPROM library from Arduino framework for my ESP8266 project (NodeMCU). I am using Atom with Platformio.
Initialization of EEPROM is attempted at void setup() in main.cpp:
EEPROM.begin(80);
The compiler throws an error at this line with:
request for member 'begin' in '0', which is of non-class type 'int'
This is strange as I just follow a simple example from GitHub.
I include <EEPROM.h> just as <Arduino.h> and many others (<ESP8266WiFi.h>, <ESP8266WebServer.h>, <ESP8266mDNS.h>). Platformio has created .pio\build\nodemcuv2\lib32c\EEPROM directory with EEPROM.cpp.o inside but compilation fails.
How can I make it work and what else should I check to find the problem?
#include <Arduino.h>to the top, of course) - maybe theeeprom_writeone? If that works, you will be able to narrow it to something else in your code. Otherwise, you've probably got a corrupt install, or wrongplatformio.iniconfiguration. You didn't add EEPROM to thelib_deps, did you? As you should be using the espressif8266 platform provided EEPROM library.