hi,
i start programming on C, and have 3 little questions to it.
-
i’ve declare a :
char text[41];
fill it up with chars and want to put out on LCD:
MIOS_LCD_PrintCString(text);
why isn’t that able? something is written in compiler error about invalid types. i see that there is a “code” before char* str in PrintCString declaration. What is the meaning of that? special type? Can’t i send a complete char array to LCD… only const strings or is there a other way? 2…so i’ve try to put out single chars and store in my char array: first i get in letters and store them in array…
MIOS_LCD_CursorSet(MIOS_LCD_CursorGet());
text[MIOS_LCD_CursorGet()] = letter; // letter is a char
text[MIOS_LCD_CursorGet()+1] = '\0';
MIOS_LCD_PrintChar(text[MIOS_LCD_CursorGet()]);
MIOS_LCD_CursorSet(MIOS_LCD_CursorGet()+1);
..end here later, i want to output the whole char array on LCD:
unsigned char i;
MIOS_LCD_CursorSet(0x00);
for(i=0; i<41; i++) {
if (text[i] == '\0') break;
MIOS_LCD_PrintChar(text[i]);
}
..but if input a “HELLO” then i get back a “HELLO+filled Rectangle char”. Don’t understand… seems there is something wrong in my input routine (MIOS_LCD_CursorGet / MIOS_LCD_CursorSet) ?
the LCD shows me not the 5 letters HELLO, but instead the first 6 array entrys (HELLO + a Rectangle) and then after Rectangle it breaks…
Do someone knows a hint?
- if i want use strlen() Funktion i got compiling error:
..
// somewhere in code:
strlen(test);
..
Linking project
error: missing definition for symbol “_strlen”, required by “_output\main.o”
ERROR!
Process terminated with status 1 (0 minutes, 3 seconds)
0 errors, 0 warnings
i’ve additional included in main.c:
include <string.h>
I don’t understand? Any helps?