UTFT and Fonts help

Ok so I have another error being thrown up due to a different font im trying to use. I have arial_bold.c in my sketch folder and am receiving the following error. Arduino: 1.6.1 (Windows 7), Board: “Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)”

 C:\Program Files (x86)\Arduino\libraries\UTFT\arial_bold.c:9:9: error: variable 'arial_bold' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

 uint8_t arial_bold[3044] PROGMEM={ [code]

here is the bit of my code im using for a variable [code]//*******Included Libraries*******//
#include <UTouch.h>
#include <avr/pgmspace.h>
#include <UTFT.h>
#include <tinyFAT.h>
#include <UTFT_tinyFAT.h>
#include <EEPROM.h>
#include <RTClib.h>
#include <Wire.h>
#include <OneWire.h>
#include <DallasTemperature.h>

//********    Declare Touch/LCD/RTC    **********
UTFT  myGLCD(ITDB50, 38, 39, 40, 41);   //sets LCD pins - change to your screen pin-out and aspect
UTouch  myTouch( 6, 5, 4, 3, 2);        //sets touch pins - change to your set up (default is usually 6,5,4,3,2)
UTFT_tinyFAT myFiles(&myGLCD);
RTC_DS1307 RTC;


//********   Call Fonts    **********
extern uint8_t arial_bold[];
extern uint8_t Sinclair_S[];
extern uint8_t SevenSegmentFull[];[code]

any help to make this work will be appreciated thank you.

What does the font file look like? If it says prog_char, change it to const char

const char gives me

Arduino: 1.6.1 (Windows 7), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

AquaPorn.ino:47:12: error: uninitialized const 'arial_bold' [-fpermissive]

AquaPorn.ino:47:23: error: storage size of 'arial_bold' isn't known

Error compiling.


[code]

not sure what you mean by the font type, this is the .c file

arial_bold.c (15.8 KB)

It should look like this.

const char arial_bold[3044] PROGMEM={

not uint8_t

ok, I got that changed now it throws up more errors.

//*******Included Libraries*******//
#include <UTouch.h>
#include <avr/pgmspace.h>
#include <UTFT.h>
#include <tinyFAT.h>
#include <UTFT_tinyFAT.h>
#include <EEPROM.h>
#include <RTClib.h>
#include <Wire.h>
#include <OneWire.h>
#include <DallasTemperature.h>

//********    Declare Touch/LCD/RTC    **********
UTFT  myGLCD(ITDB50, 38, 39, 40, 41);   //sets LCD pins - change to your screen pin-out and aspect
UTouch  myTouch( 6, 5, 4, 3, 2);        //sets touch pins - change to your set up (default is usually 6,5,4,3,2)
UTFT_tinyFAT myFiles(&myGLCD);
RTC_DS1307 RTC;


//********   Call Fonts    **********
const char arial_bold[3044] PROGMEM={
extern uint8_t Sinclair_S[];
extern uint8_t SevenSegmentFull[];


void Print_Change_Sunrise12() {                        //12 hour schedule

  if (ledevents_screen == true);
  if (SunTwelve == true) {

    myGLCD.setFont(arial_bold);
    myGLCD.setColor(0, 255, 255);

    if ((RiseHour <= 11) && (RiseHour >= 10)) {
      myGLCD.setBackColor(0, 0, 0);
      myGLCD.printNumI(RiseHour, 21, 76);
    }
    if ((RiseHour <= 9) && (RiseHour >= 1)) {
      myGLCD.setBackColor(0, 0, 0);
      myGLCD.printNumI(RiseHour, 32, 76);
    }
    if (RiseMin == 0) {
      myGLCD.setBackColor(0, 0, 0);
      myGLCD.print ("0" , 70, 76);
      myGLCD.printNumI(RiseMin, 85, 76);
    }
    if ((RiseMin >= 10) && (RiseMin <= 59)) {
      myGLCD.setBackColor(0, 0, 0);
      myGLCD.printNumI(RiseMin, 69, 76);
    }

    myGLCD.setColor(127, 127, 127);
    myGLCD.setBackColor(255, 0, 0);
    myGLCD.printNumI(RiseHour + 12, 20, 141);
    myGLCD.printNumI(RiseMin + 14, 68, 141);

    if (RiseMin == 0) {
      myGLCD.printNumI(RiseMin + 14, 68, 141);
    }
  }
}
//*****************************************************************************************************
void Print_Change_Sunrise8() {                        //8 hour schedule

  if (ledevents_screen == true);
  if (SunEight == true) {

    myGLCD.setFont(arial_bold);
    myGLCD.setColor(0, 255, 255);

    if ((RiseHour <= 15) && (RiseHour >= 10)) {
      myGLCD.setBackColor(0, 0, 0);
      myGLCD.printNumI(RiseHour, 21, 76);
    }
    if ((RiseHour <= 9) && (RiseHour >= 1)) {
      myGLCD.setBackColor(0, 0, 0);
      myGLCD.printNumI(RiseHour, 32, 76);
    }
    if (RiseMin == 0) {
      myGLCD.setBackColor(0, 0, 0);
      myGLCD.print ("0" , 70, 76);
      myGLCD.printNumI(RiseMin, 85, 76);
    }
    if ((RiseMin >= 10) && (RiseMin <= 59)) {
      myGLCD.setBackColor(0, 0, 0);
      myGLCD.printNumI(RiseMin, 69, 76);
    }

    myGLCD.setColor(127, 127, 127);
    myGLCD.setBackColor(255, 0, 0);
    myGLCD.printNumI(RiseHour + 8, 20, 141);
    myGLCD.printNumI(RiseMin + 14, 68, 141);

    if (RiseMin == 0) {
      myGLCD.printNumI(RiseMin + 14, 68, 141);
    }
  }
}

error...

Arduino: 1.6.1 (Windows 7), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

AquaPorn.ino:47:37: error: expected primary-expression before ';' token

AquaPorn.ino: In function 'void Print_Change_Sunrise12()':

AquaPorn.ino:582:30: error: invalid conversion from '<type error>' to 'uint8_t* {aka unsigned char*}' [-fpermissive]

In file included from AquaPorn.ino:30:0:

C:\Program Files (x86)\Arduino\libraries\UTFT/UTFT.h:219:8: error:   initializing argument 1 of 'void UTFT::setFont(uint8_t*)' [-fpermissive]

   void setFont(uint8_t* font);

:roll_eyes: No, this needs to be changed in the arial bold font file, not the sketch.

const char arial_bold[3044] PROGMEM={

Then in the sketch you need to add

extern uint8_t arial_bold[];

Done and Done, thanks for the help it works perfect now.

Your welcome.