I had a little bit time today so I made a very simple example.
Here are pictures from the theory set up to practice:http://img121.imageshack.us/img121/6674/lcd1.jpghttp://img706.imageshack.us/img706/1736/lcd2.jpghttp://img38.imageshack.us/img38/2751/lcd3w.jpghttp://img13.imageshack.us/img13/8853/lcd4.jpgAnd there is a video from the test program I made (sorry for the blurred image -> cellphone camera):http://www.youtube.com/watch?v=N2vefMl8DVMAnd last but not least a tutorial on how to create custom chars for character LCD:http://www.8051projects.net/lcd-interfacing/lcd-custom-character.phpHere is some code snippet from my very very simple calculation of the
vertical values as described in my previous post.
y = 100;
y /= k;
y *= x;
if(y<=50){
y /= 8;
lcd_gotoxy(0,1);
lcd_putc(y);
}
else if(y>50){
y -= 50;
y /= 8;
lcd_gotoxy(0,1);
lcd_putc(0x07);
lcd_gotoxy(0,0);
lcd_putc(y);
}
lcd_putc(0x07); means use the 8. custom char which is the full block alias the indicator for 50% (8*5 dots).
0x01 is just the line on the ground (1*5 dots) and 0x04 is half of a block = 25% (4*5 dots)