Arduino Error: WProgram.h/ No such file or directory
증상
컴파일시 WProgrma.h 파일 없음 메시지
/arduino/FWXYIQ4G1BBD44S/FWXYIQ4G1BBD44S.ino:3:22: fatal error: WProgram.h: No such file or directory
#include "WProgram.h"
^
compilation terminated.
exit status 1
Error compiling for board Arduino/Genuino Uno.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
원인
옛 아두이노 0.0. xx 버전에서의 WProgram.h는 최근의 아두이노 1.0.xx 이상 버전에서에서 Arduino.h 로 변경됨.
해결책
소스 코드중
#include "WProgram.h"
를
#if defined(ARDUINO) && (ARDUINO >= 100)
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
로 수정한다.
잘 된다.