Printing to LCD in 4 languages ​​in C

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
tello
Posts: 94
Joined: Wed Jan 16, 2013 11:37 am
Has thanked: 56 times
Been thanked: 16 times

Printing to LCD in 4 languages ​​in C

Post by tello »

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
Attachments
Prueba_codigo_display.fcf
Program
(14.88 KiB) Downloaded 293 times

tello
Posts: 94
Joined: Wed Jan 16, 2013 11:37 am
Has thanked: 56 times
Been thanked: 16 times

Re: Printing to LCD in 4 languages ​​in C

Post by tello »

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
Attachments
Prueba_codigo_display.fcf
(15.91 KiB) Downloaded 306 times

User avatar
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

Post by LeighM »

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…

Code: Select all

switch (Idioma) {
case '1':
so change it to

Code: Select all

case 1:
and same for case 2:

Regards
Leigh

User avatar
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

Post by LeighM »

.. and just a reminder that Custom C macros will not simulate
Leigh

tello
Posts: 94
Joined: Wed Jan 16, 2013 11:37 am
Has thanked: 56 times
Been thanked: 16 times

Re: Printing to LCD in 4 languages ​​in C

Post by tello »

comparacion.JPG
comparacion.JPG (143.86 KiB) Viewed 5935 times
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
Attachments
Prueba_codigo_display.fcf
(14.53 KiB) Downloaded 330 times

User avatar
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

Post by LeighM »

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

tello
Posts: 94
Joined: Wed Jan 16, 2013 11:37 am
Has thanked: 56 times
Been thanked: 16 times

Re: Printing to LCD in 4 languages ​​in C

Post by tello »

Thanks, I looked CASM file but do not understand much of anything.

Post Reply