Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Thread Closed: Another thread already exists on this topic

???
02/16/05 15:53
Read: times


 
#87672 - New to MicroC
Ok We're kind of new to this MicroC programming thing so I'm sorry we keep sending code in wrong format. What our main question is is how can we take a string value out of an array and print it to the LCD? When we use the LCD_puts function(array[x]) we get a black screen printed onto the LCD, when we use LCD_putc(array[x]) hoever we only get the last value of the arrays value printed.

Example:
if array[0] is loaded with '12', our LCD will print out 2
if array[0] is loaded with '35', our LCD will print out 5

Is there a function or way to send both values to the LCD to print out, Please tolerate our ignorance since we are lost and have no idea wher to go from here. Thanks

void LCD_putc(unsigned char key)
{
unsigned char value1, value2; // Create variables value1, value2
value1=key&0xF0; // Use OR function to separate low nibble out
value1=value1|0x05; // Use AND function to make low nibble 5
P0=value1; // Send out high nibble
EN_low();
value2=key&0x0F; // Use OR function to separate high nibble out
value2=value2<<4; // Shift low nibble bits to high nibble position
value2=value2|0x05; // Use AND function to make low nibble 5
P0=value2; // Send out low nibble
EN_low();
}

void LCD_puts(const unsigned char *str)
{
register unsigned char char1; // Create registered variable char1
while ((char1=*str++)) // While next character in the string is not null …
{
LCD_putc(char1); // Run function LCD_putc with input "char1"
}
}

List of 3 messages in thread
TopicAuthorDate
New to MicroC            01/01/70 00:00      
   Why do you start a new thread            01/01/70 00:00      
   Try            01/01/70 00:00      

Back to Subject List