Hey guys, I'm making a macro that Quierí print on the LCD in 4 languages. Apparently it's very simple but I can not fix the error, and if I do another mistake out later.
Can anyone help me out to correct the fault? do not know how to fix it.
Thank you. attached screenshot program
Printing to LCD in 4 languages in C
Moderator: Benj
Printing to LCD in 4 languages in C
- Attachments
-
- Prueba_codigo_display.fcf
- Program
- (14.88 KiB) Downloaded 293 times
Re: Printing to LCD in 4 languages in C
Hello again, I made some changes and there is no error but does not work properly.
I think the problem is that I have to declare the variable Byte "Idioma" in the C code of the macro.
As I can declare the variable within the macro??
When the macro ends and work properly will put at the disposal of all.
thanks
I think the problem is that I have to declare the variable Byte "Idioma" in the C code of the macro.
As I can declare the variable within the macro??
When the macro ends and work properly will put at the disposal of all.
thanks
- Attachments
-
- Prueba_codigo_display.fcf
- (15.91 KiB) Downloaded 306 times
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: Printing to LCD in 4 languages in C
Hi
You are very close to working.
Just a little bug in that your custom C code IDOMAS parameter Idioma is confused.
The switch is looking for the character 1 (hex 0x31) rather than the number 1
Here…
so change it to
and same for case 2:
Regards
Leigh
You are very close to working.
Just a little bug in that your custom C code IDOMAS parameter Idioma is confused.
The switch is looking for the character 1 (hex 0x31) rather than the number 1
Here…
Code: Select all
switch (Idioma) {
case '1':
Code: Select all
case 1:
Regards
Leigh
Re: Printing to LCD in 4 languages in C
Thank you very much LeighM. The macro is now working well.
I have a question, my intention to make the macro was to save program memory, but the result is greater with the macro setting separate blocks, why?? I do not understand.
Someone can explain??
Thank you very much again
I have a question, my intention to make the macro was to save program memory, but the result is greater with the macro setting separate blocks, why?? I do not understand.
Someone can explain??
Thank you very much again
- Attachments
-
- Prueba_codigo_display.fcf
- (14.53 KiB) Downloaded 330 times
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: Printing to LCD in 4 languages in C
Hi,
Compare the two generated .casm files. These will show you which macros are being used and how much assembler code and hence memory space they require.
Leigh
Compare the two generated .casm files. These will show you which macros are being used and how much assembler code and hence memory space they require.
Leigh