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
LCD getting number of columns
Moderator: Benj
LCD getting number of columns
- 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.
- 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
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?
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?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: LCD getting number of columns
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,
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,
Re: LCD getting number of columns
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
The only downside is what is happening if 2 LCD's are connected!
Everyday I learn more about flowcode
Thanks for the advice to try the software on the hardware.
reagrds Frank
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

The only downside is what is happening if 2 LCD's are connected!
Everyday I learn more about flowcode

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