foggysail
Newbie level 6
I have a small home project using C18 with a PIC18F4550 that needs to display some digitally adjusted 3 digit integers along with text strings on four lines of a 20X4 LCD display. Now those familiar with Newhaven ...and maybe for all I know, other similar displays, one can write a byte (WriteI2C(0x21) for example) at a time or a string with a putI2C(). For the byte which is actually 2 bytes with only one byte getting displayed, one needs to use Newhaven's ASCII table. It means only 1 digit at a time can be presented to the display.
Now of course, if you have an integer then it needs to be broken up to units, tens, hundreds and so forth so that individual digits can be ASCII coded then written. Example.... 123 needs to be 1, 2, 3 and then 1 could be written using ASCII which would be 0x31, 2 would be 0x32 and so forth. MESSY! Worse, I cannot see how to use a varible in a string for the putI2C().
Sure, I have a routine that will separate the integer digits and an array to call the digits for display. But that again is messy.
Is there any way to circumvent this stuff with pointers? I tried using them in the put command but it treated the pointer as a string as one would expect and not as a pointer to a variable.
If there are/is a way to do so, can you give an example?
Thanks--
Foggy
Now of course, if you have an integer then it needs to be broken up to units, tens, hundreds and so forth so that individual digits can be ASCII coded then written. Example.... 123 needs to be 1, 2, 3 and then 1 could be written using ASCII which would be 0x31, 2 would be 0x32 and so forth. MESSY! Worse, I cannot see how to use a varible in a string for the putI2C().
Sure, I have a routine that will separate the integer digits and an array to call the digits for display. But that again is messy.
Is there any way to circumvent this stuff with pointers? I tried using them in the put command but it treated the pointer as a string as one would expect and not as a pointer to a variable.
If there are/is a way to do so, can you give an example?
Thanks--
Foggy