Choose and write from value.

Thread Starter

FroceMaster

Joined Jan 28, 2012
708
Hi.
Difficult to explain but here we go.

Have Microchip and LCD and need to do following.

20 variables in "raindays"
have special charters in LCD that need to be show depend on value in variables.
Like a collumdiagram.
The special charter i have is just the botton line in LCD and number 2 is 2 line, and 3 lines ect until last special char that is "full" ( 8 line)
simpel, if raindays[0] is ex 10 then i need to lid up 10 "lines" in first cullom, line 4 in LCD "full" and 2 lines i line 3 of LCD,
So that i will have a "PINDIAGRAM" if you got my meaning,

feel free to ask more,
 

ericgibbs

Joined Jan 29, 2010
21,390
hi FM,
What you are describing is using the 4 Line LCD as a Bar Graph, showing the different rainfall values.
What help are you are asking for.??
E
 

LesJones

Joined Jan 8, 2017
4,511
I thought that and then noticed he had answered in the first line of post #4
The fact that it is "C" rules me out as being able to help.

Les.
 

Thread Starter

FroceMaster

Joined Jan 28, 2012
708
Code:
 lcd1_goto(0x00);

  lcd1_puts("  Daily rain 1-20");

    // all data is loaded to variables. raindays[]

  char d;

  int x;

   for (d=19;d>=0;d--);  //loop to load days,

  {

  x=raindays[d];

  if (x>15 && x<23)

{lcd1_goto(0x40+d); // line 2

Lcd1_print_char(x-15); // should give me ex 22-15 = char 7

lcd1_goto(0x14+d);  // line 3

lcd1_print_char(7); // full house

lcd1_goto(0x54+d); // line 4

lcd1_print_char(7); // full house

}

if (x<17 && x>8)

{lcd1_goto(0x14+d);//line 3 // between 8 and 16

lcd1_print_char(x-7) ;

lcd1_goto(0x54); // line 4

lcd1_print_char(7); // full house




}
think i got i now ;)
 
Hi.
Difficult to explain but here we go.

Have Microchip and LCD and need to do following.

20 variables in "raindays"
have special charters in LCD that need to be show depend on value in variables.
Like a collumdiagram.
The special charter i have is just the botton line in LCD and number 2 is 2 line, and 3 lines ect until last special char that is "full" ( 8 line)
simpel, if raindays[0] is ex 10 then i need to lid up 10 "lines" in first cullom, line 4 in LCD "full" and 2 lines i line 3 of LCD,
So that i will have a "PINDIAGRAM" if you got my meaning,

feel free to ask more,
It is difficult for me to understand what you are saying. You may want to look into the ability to program custom characters. This will depend on the LCD/controller, but many common ones support this feature.

Basically, you would program 8 custom characters, with ascending numbers of horizontal dots forming "bars of different heights". Then, you can display what you appear to want to display fairly easy (assuming I am understanding you).

You can see an example of programming custom characters using 'C' here - although not with a PIC.



You can also search on the subject - there are many examples to be found.
 

WBahn

Joined Mar 31, 2012
32,703
@FroceMaster: Is this any kind of school assignment? If so, I can move it to Homework Help where you will tend to get assistance aimed at helping you learn what you need to succeed in doing these tasks on your own.
 

Thread Starter

FroceMaster

Joined Jan 28, 2012
708
Have considered to use craphic but seems to difficult,

No not a school project,
It's for my self , and learning by doing,
All programming is started from zero, for many years ago i started in TurboPascal, moved up to VB6
and later VB.net, and C code for PIC. just by reading internet and help in here.
 
Top