Hello,
To display a dynamic count value on the LCD, you will need to firstly setup the contents of a char array variable to contain the ASCII characters representing the digits associated with the count. This will require that you convert the current binary counter value to an ASCII representation, and write each character to the required location within the array.
Since the display function commences at the start of each line, you may need to pad the array with spaces, or other characters, and then finally "null terminate" the array. You will also need to decide whether to suppress leading zeros for the count, i.e. replace leading zeros with spaces.
You can then display the array as you would a constant string.
byte array1[17], i;
// Fill array with spaces
for (i = 0; i < 16; i++)
array1[i] = ' ';
array1[16] = 0; // Null termination
// Convert counter value here and load digits to array1
...
lcd_string( 2, array1);
Regards,
Mac
Message Edited by bigmac on 2009-03-03 03:40 PM