Forum: µC & Digital Electronics Display ( ST7565)

von Jean-pierre K. (jean)

Rate this post
0 useful
not useful

I am from Belgium, i am a newbie in AVR en C.

I have 2 questions

Whats the difference between #include "font.h" and #include <font.h> ?

The second question is a bit complicated.

How do i display a varible on my grafik display (ST7565R)
The funtions:    lcd_print2_P(60,28, "Text 1", 
&Microsoft_Sans_Serif__13,0); works but only with strings.

Can someone help me.

int main(void)
  PortLcdCtrl|=0b00100000;  // Licht an
  lcd_print2_P(60,3, "G", &Microsoft_Sans_Serif__13,0);
  lcd_print2_P(60,28, "Text 1", &Microsoft_Sans_Serif__13,0);
  lcd_print2_P(60,48, "Text 2", &Times_New_Roman__8,0);
  //lcd_print2_P(140,28, "Text 3", &Microsoft_Sans_Serif__13,0);
  //lcd_print2_P(140,48, "Text 4", &Microsoft_Sans_Serif__13,0);
  char     texte[10];
  double     komma;
  komma= komma+1;
  dtostrf (komma, 10, 1, texte);

  lcd_print2_P(40,10,texte, &Times_New_Roman__8,0);//I want to print the 
variable texte on my display, how?
  {  ;


: Moved by Moderator
von JD (Guest)

Rate this post
0 useful
not useful
"font.h" searches for the file in the current directory, <font.h> 
searches all defined include directories, I think.

If you want to print a variable/number via that function you have to 
convert it to a string first, e.g. using sprintf() or similar.

von Jean-pierre K. (jean)

Rate this post
0 useful
not useful
Thank you for the respons

My first question is solved with your anwser.

I thought dat "dtostrf made from the variable "komma" a string "texte"

Can you write some code how i can print this on my grafik display with 


 lcd_print2_P(40,10,"texte", &Times_New_Roman__8,0);

this wil print texte on the display and not 70


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.