How do I use PlatformIO to flash ESP-12F (ESP8266MOD)
At the PlatformIO community I asked the same question, and pfeerick  suggested to add a build flag.


  It’s most likely the onboard LED is on GPIO2, not GPIO1 so try adding
  
  build_flags = -D LED_BUILTIN=2 to your platformio.ini … hopefully that
  kicks in before the pins_arduino.h defintion.


But It didn't did the trick.
And the compiler throws a bunch of warnings.
What I did to make it work is to ignore LED_BUILTIN constant and use 2 instead. 

#include &lt;Arduino.h&gt;
void setup() {
 pinMode(2, OUTPUT);
}

void loop() 
{
  digitalWrite(2,LOW);
  delay(200);
  digitalWrite(2,HIGH);
  delay(200);
}