GitHub - Seeed-Studio/OLED_Display_128X64: Seeed OLED Display 128*64 library
arduino v1.0 compile error: avr\pgmspace.h: No such file or directory
Grove - OLED Display 0.96 inch - Seeed Wiki
Macの場合、そのままだとエラーがでます
Arduino:1.8.5 (Mac OS X), ボード:"Arduino/Genuino Uno"
/Users/atsu/Documents/Arduino/libraries/SeeedOLED_Display_128X64-master/SeeedOLED.cpp:29:26: fatal error: avr\pgmspace.h: No such file or directory
#include <avr\pgmspace.h>
^
compilation terminated.
exit status 1
ボードArduino/Genuino Unoに対するコンパイル時にエラーが発生しました。
「ファイル」メニューの「環境設定」から
「より詳細な情報を表示する:コンパイル」を有効にすると
より詳しい情報が表示されます。
SeeedOLED.cppの以下の行のavrの次の文字を/(バックスラッシュ) に変更します。
# include <avr\pgmspace.h>
# include <avr/pgmspace.h>
変更後にはビルドが通ります。
OLED_Hello_World.ino
# include <Wire.h>
# include <SeeedOLED.h>
void setup()
{
Wire.begin();
SeeedOled.init(); //initialze SEEED OLED display
SeeedOled.clearDisplay(); //clear the screen and set start position to top left corner
SeeedOled.setNormalDisplay(); //Set display to normal mode (i.e non-inverse mode)
SeeedOled.setPageMode(); //Set addressing mode to Page Mode
SeeedOled.setTextXY(0,0); //Set the cursor to Xth Page, Yth Column
SeeedOled.putString("Hello World!"); //Print the String
}
void loop()
{
}