What shall I learn in order to send values from 0.00 to 5.00?
I'm working with they Hitachi 16x2 LCD display.
I've been sending/displaying literal values on it all day. Meaning,
where the variable val corresponds to the LCD character table.Code:SendCharater(unsigned char val)
I can also send Hello World to the display, like so:
I could type in putsXLCD("5.00") in order to display it on the LCD, but how do I implement this automatically for values, e.g. 0.00 to 5.00?Code:void putsXLCD(unsigned char *buffer){ while(*buffer) // Write data to LCD up to null { while( BusyXLCD() ); // Wait while LCD is busy SendCharacter(*buffer); // Write character to LCD buffer++; // Increment buffer } return; }
It appears I can only pass literal values through the function SendCharacter, meaning that in order to display "0" I have to pass the value 0x30 (the hex value of "0" on the LCD Table).
My current thought process:
Much like passing "Hello World" in the function putsXLCD(), I need to assign a pointer that points at each value in the "array" that I need to send. E.g., I need to send 3.24, so I need to point to "3", fetch the corresponding hex value in the LCD table, in this case 0x34, and the pass this 0x34 into the SendCharacter function, and so on. So, if this is the case, how can I fetch the corresponding hex value?