| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| mkr 
 
 
 Joined: 08 Aug 2006
 Posts: 49
 
 
 
			    
 
 | 
			
				| Help on T6963C LCD controller |  
				|  Posted: Thu Mar 29, 2007 7:14 am |   |  
				| 
 |  
				| Hello All, I asked a dum question earlier on sending a string "ABC" to T6963C based LCD.
 I am using the driver now. I simply wanted to send "ABC" using the glcd_putc("ABC");, seems that the
 argument of the function is a character type. How can I then send a string.
 Are there bits and peices of the code not posted or si the whole code posted.
 
 My MCU is dsPIC30F6014a and LCD is 240x128 pixel. I have selected 8x8 font size and CE is always tied to low.
 
 Here is the code snippet.
 Code:
 
 
 
 
  	  | Code: |  	  | int main(void)
 {
 
 init_io();
 
 glcd_init();
 
 glcd_WriteByte(1, (LCDModeSet|LCDMode_XOR));
 glcd_WriteByte(1, (LCDDispMode|LCDDisp_TXT|LCDDisp_GRH));
 
 glcd_gotoxy(4,3,1); // 1 = text area of memory; note that there are only
 // 16 rows of text possible
 glcd_putc("ABC");
 
 
 
 
 } //End of main()
 
 
 | 
 
 help please
 _________________
 Thanks
 
 mkr
 |  | 
	
		|  | 
	
		| treitmey 
 
 
 Joined: 23 Jan 2004
 Posts: 1094
 Location: Appleton,WI   USA
 
 
			      
 
 | 
			
				|  |  
				|  Posted: Thu Mar 29, 2007 8:26 am |   |  
				| 
 |  
				| The compiler will((magically)) take a function that accepts a char, and make a loop for you that will call it multiple times for a string.  so.. to print a string you
 
 
  	  | Code: |  	  | glcd_WriteCmd0(AutoModeReset); glcd_WriteCmd0(LCDDispMode | LCDDisp_TXT| LCDDisp_GRH);
 printf(glcd_putc,"Good Morning!");
 | 
 
 This has the printf using the glcd_putc function.. and it would normally
 take just a single char.. but the compiler puts in a loop that calls
 glcd_putc once for EVERY char in "Good Morning!" string.
 
 Also look at C:\Program Files\PICC\Examples\EX_LCDKB.C
 and  C:\Program Files\PICC\Drivers\LCD.C
 see how lcd_putc just takes a single char but in the example it is
 given a string and works on with it.  This may not be the case for future compilers.
 |  | 
	
		|  | 
	
		|  |