Programming ESP8266 (NODEMCU) with arduino IDE

hello fools

today i bought a nodeMCU, for testing propouses and integrate my solution in Arduino whit this MC, i flashed and start to work with Arduino IDE.

i connected a HC-SR04 Ultrasonic Sensor and try to use the NewPing Library i fond this error:

fatal error: avr/pgmspace.h: No such file or directory
 #include <avr/pgmspace.h>

i browse the web and i found the hacked library and seems good, but it appears a new error message:

fatal error: avr/io.h: No such file or directory
 #include <avr/io.h>

i really want to program my NodeMCU with Arduino IDE but now i couldn't find info to how to manage Sensor With lua and found error using Arduino IDE

Help me its really important for me and i Didn't found info.

One thing to note: the processor in the ESP8266 is NOT and Atmel AVR processor. You should not expect any code that relies on AVR features to work on it without modification.