LCD getting number of columns

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
yfands
Flowcode V4 User
Posts: 12
Joined: Wed May 05, 2010 12:33 pm
Has thanked: 3 times

LCD getting number of columns

Post by yfands »

Hello,

For a neat scrolling effect regarding the LCD, I'am in need of the Columns (and rows) used by the LCD. (16, 20, 40, 80)

So far I tried to use C Code and the variable %s_COLCNT (used by the LCD macro's) to assign to the flowcode variable Xp.

and to create a custom LCD macro getcol (return %s_COLCNT) also trying to assign it to the variable Xp.

even tried replacing the %s by the devicename (After compiling available in the .c file).

In common, how can I access the variable's used by the components?

attached file is a small attempt with no luck.

regards Frank
Attachments
LCD_get_columns.fcf
LCD get columns
(5.5 KiB) Downloaded 308 times
Last edited by yfands on Sun Sep 12, 2010 8:50 am, edited 1 time in total.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: LCD getting number of columns

Post by Benj »

Hello Frank,

Your function looks good but will only work on the hardware as it is using custom C code. Have you tried it out on the hardware?

yfands
Flowcode V4 User
Posts: 12
Joined: Wed May 05, 2010 12:33 pm
Has thanked: 3 times

Re: LCD getting number of columns

Post by yfands »

Hello Ben,

Thanks for your reply, I didn't think it would be usefull to test it on the hardware,
because the simulation didn't work. I will try it today (sunday) and will let you know.

regards Frank,

yfands
Flowcode V4 User
Posts: 12
Joined: Wed May 05, 2010 12:33 pm
Has thanked: 3 times

Re: LCD getting number of columns

Post by yfands »

Hello Ben,

Sorry fot the late reply,
The code doesn't work, and I wanted to try some other options.

The problem lies with the %s_COLCNT, the %s must be substituted by the unique
number that the LCD component gets (by the linker ?)

If I replace the %s by that number in the functioncall in flowcode it works and I get the
columnnumber. unfortunately the number is "random" and can't therefore be used in the flowcode.

The only option I see is to modify the PIC_LCD.c file and add a variable i.e.
define FCV_COLCNT %u
(the %u is substituted into (this time) 16)

I added in the project options menu the sublementary code

unsigned char Get_LCD_Col(void)
{
return FCV_COLCNT;
}

and voila the columncount is available :P

The only downside is what is happening if 2 LCD's are connected!


Everyday I learn more about flowcode :mrgreen:

Thanks for the advice to try the software on the hardware.

reagrds Frank

Post Reply