Go Down

Topic: Nokia 5110 Attiny, 3v (Read 2 times) previous topic - next topic

Tom Carpenter

Eurgh, yeah, woops. I forgot that there are other bits in the core which are based around that version of Print being incorrect.

What you may have to do is to undo the changes to Print.h and Print.cpp, and instead change the Adafruit_GFX.h and Adafruit_GFX.cpp. Could you post the Adafruit library, and I can tell you what needs to be changed.
~Tom~


stoopkid

The other thing is though that the library seems to big for the 84. It compiles at almost 9kb. So it would need to be pruned in order to work. To display any text or anything it also requires this library:
https://github.com/adafruit/Adafruit-GFX-Library

Tom Carpenter

If you put the Print library back to how it was (I think i put the original in my first post), and change the following

In Adafruit_GFX.cpp
Code: [Select]

#if defined(__AVR_ATtiny84__)
void Adafruit_GFX::write(uint8_t c) { //This line has been added
#elif ARDUINO >= 100
size_t Adafruit_GFX::write(uint8_t c) {
#else
void Adafruit_GFX::write(uint8_t c) {
#endif
 if (c == '\n') {
   cursor_y += textsize*8;
   cursor_x = 0;
 } else if (c == '\r') {
   // skip em
 } else {
   drawChar(cursor_x, cursor_y, c, textcolor, textbgcolor, textsize);
   cursor_x += textsize*6;
   if (wrap && (cursor_x > (_width - textsize*6))) {
     cursor_y += textsize*8;
     cursor_x = 0;
   }
 }
#if defined(__AVR_ATtiny84__)
#elif ARDUINO >= 100
 return 1;
#endif
}


In Adafruit_GFX.h
Code: [Select]

#if defined(__AVR_ATtiny84__)
 virtual void write(uint8_t); //this line is new
#elif ARDUINO >= 100
 virtual size_t write(uint8_t);
#else
 virtual void write(uint8_t);
#endif
~Tom~

stoopkid

I changed back the tiny cores, and added those changes to the GFX files and I still get the same errors but also with this at the end

Code: [Select]
In file included from pcdtest.cpp:19:
C:\Users\Nick\Documents\Arduino\libraries\Adafruit_GFX/Adafruit_GFX.h:27: error: virtual outside class declaration

Go Up