I need to print 15 bytes stored in the Bankstick memory (starting at 0x0006) on the LCD. Unfortunately I do not fully understand which MIOS_LCD_Print… command to use. My idea was to store the bytes read from the Bankstick in an array [tt]unsigned char card_name[15][/tt], but then how can I display the content of that array on screen? The C functions description does not really get me there, because I get all kinds of “…from type…to type…” errors from the compiler. Can somebody help?
maybe you could use this for displaying the contents:
unsigned int index;
unsigned char value;
//print first 8 numbers
MIOS_LCD_CursorSet(0x00);
for (index = 0x06; index < 0x06 + 8; index++) {
value = MIOS_BANKSTICK_Read(index);
MIOS_LCD_PrintHex2(value);
}
//print the other values on the second line
MIOS_LCD_CursorSet(0x40);
for (index = 0x06 + 8; index < 0x06 + 15; index++) {
value = MIOS_BANKSTICK_Read(index);
MIOS_LCD_PrintHex2(value);
}
it uses no array, but it seems to work all values are printed in hex without any spaces, otherwise it wouldn’t fit on the lcd… About those errors, maybe you tried something like this?
MIOS_LCD_PrintHex2(card_name);
since the functions only accept a single byte, you have to right a little loop to print your array:
this should work for numbers, but unfortunately those characters to be displayed are stored in ASCII format. From what I understand from the MIOS Functions Reference your suggestion will give me the hex representation of the characters, right?
So I guess it comes down to using [tt]MIOS_LCD_PrintPreconfString[/tt], but how do I preconfigure that string by reading the bytes from the Bankstick’s memory?
There’s a function implemented in the ACSim Debugger code that prints bankstick contents as Hex and ASCII to the console. Maybe this is adaptable to MIOS-apps.
What would I need to do to save it as a string for future use? I seem to be having difficulties with the const declaration required for the PreconfString. As the string will change rather often I am looking for something like the classic string type of C variable… how could I return this from my function?
You notice that I have not been programming a lot…