??? 12/27/05 09:42 Read: times |
#105999 - Try this. Responding to: ???'s previous message |
Anton Wijaya said:
// Pointer physically in internal ram pointing to object in external ram xdata unsigned char * data Strings1Ptr; xdata unsigned char * data Strings2Ptr; xdata char Strings1[256]; xdata char Strings2[256]; void main (void) { Strings1[0] = 'H'; Strings1[1] = 'e'; Strings1[2] = 'l'; Strings1[3] = 'l'; Strings1[4] = 'o'; // there is must be a way to set strings insted of above Like this!? xdata char Strings1[256] = {"HELLO"}; Anton Wijaya said:
Strings1Ptr = Strings1; Strings2Ptr = Strings2; printlcd (0x00, Strings1Ptr); // "Hello" word was displayed on first line of LCD display strcat (Strings1Ptr, " Word"); Here you can use following code just to check the output while debugging. TI = 1; printf ("new string is %s\n", Strings1); Anton Wijaya said:
printlcd (0x40, Strings1Ptr); // only "Hello" word was displayed on second line of LCD display There are two things to see. First your printlcd is not printing and second the strcat is not working. Now bypass first and concentrate on second. What results you get after debugging it? Whether the program hangs or what? Check the string by outputting it on serial port as shown above. Hope this will tell where the problem lies. If strcat works, then the full string Hello World will get printed on serial port. Regards Sarang |
Topic | Author | Date |
Strings Manipulation in SDCC | 01/01/70 00:00 | |
Include ? | 01/01/70 00:00 | |
#include | 01/01/70 00:00 | |
Debug it! | 01/01/70 00:00 | |
check out Andy's doubt. | 01/01/70 00:00 | |
Hello World | 01/01/70 00:00 | |
Try this. | 01/01/70 00:00 | |
Bad! | 01/01/70 00:00 | |
Clarify![]() | 01/01/70 00:00 |