repaper / gratis

EPD Source codes and Documentation
238 stars 132 forks source link

thermo.ino is not compiling #5

Closed santioa closed 10 years ago

santioa commented 10 years ago

I was trying to play the thermo.ino example using Arduino Mega. I have added the EPD_GFX and Adafruit_GFX libraries. The following error is displayed when trying to compile:

In file included from thermo.ino:39: ...\Arduino\libraries\EPD_GFX/EPD_GFX.h: In constructor 'EPD_GFX::EPD_GFX(EPD_Class&, S5813A_Class&)': ...\Arduino\libraries\EPD_GFX/EPD_GFX.h:47: error: no matching function for call to 'Adafruit_GFX::Adafruit_GFX()' ...\Arduino\libraries\Adafruit_GFX/Adafruit_GFX.h:17: note: candidates are: Adafruit_GFX::Adafruit_GFX(int16_t, int16_t) ...\Arduino\libraries\Adafruit_GFX/Adafruit_GFX.h:13: note: Adafruit_GFX::Adafruit_GFX(const Adafruit_GFX&) ...\Arduino\libraries\EPD_GFX/EPD_GFX.h:48: error: 'constructor' was not declared in this scope

It seems that Adafruit_GFX was updated (last update 2 months ago), but EPD_GFX wasn't (last update 6 months ago). So I am thinking that some incompatibilities between these two libraries (due to EPD_GFX hasn't been updated) is the problem.

Thoughts about that? Anyone has an older version of Adafruit_GFX?

hxw commented 10 years ago

I committed a fix. Adafruit fixed the explicit call 'constructor()' problem in their graphics library. So i changed the EPD_GFX code to match, i.e. now proper C++ initialisation can be used.

I also added a drawCircle call to thermo.ino for the drgree symbol.

Please test to see if this fix works for you.

santioa commented 10 years ago

Thank you for your fast reply and fix.

Now thermo.ino is compiling but when I upload the code the eink displays the following:

2013-09-03 11 59 20

I have changed the: EPD_SIZE constant to EPD_1_44, because I am using the 1.44 size. What's wrong?

hxw commented 10 years ago

At present therm and the EPD_GFX are set to work only with 2.0" The buffer size is set in EPD_GFX.h as 200x96.

The 1.44" display is 128x96 so change the pixel_width in EPD_GFX.h from 200 to 128.

Also change the positions of the elements in the thermo.ino as to be within the 128 width. Just removing the two G_EPD.fillTriangle calls should be enough.

This should be enough to get the temperature display running

santioa commented 10 years ago

Thank you! It works now! :)