Page 1 of 1

Control of components from inside flowcode?

Posted: Sun Jun 24, 2012 8:54 pm
by cobra1
In the GLCD component file i have added in 2 lines of code to allow for contrast adjustment.

Code: Select all

gLCD_SendByte(MX_GFXLCD_CMD, 0x25); 		   //Contrast Command
gLCD_SendByte(MX_GFXLCD_PARAM, 0x51);		   //Contrast Level
I am trying to access these commands from inside flowcode so as to adjust the contrast from inside my running software.
I am not getting very far at the moment, i tried the following in a C box inside flowcode.

Code: Select all

FCD_gLCD0_gLCD_SendByte(MX_GFXLCD_CMD, 0x25); 		   //Contrast Command
FCD_gLCD0_gLCD_SendByte(MX_GFXLCD_PARAM, 0x51);		   //Contrast Level
This code compiles ok, but makes no changes when changing the parameter value from 0x51 to something different.
Is there something i am missing to connect the component file and the flowcode software together?

Re: Control of components from inside flowcode?

Posted: Mon Jun 25, 2012 4:26 pm
by Benj
Hello Cobra,

You sometimes have to do things like this with the display off or the setting does not actually update.

Maybe try using custom code on the gLCD component and editing the contrast value passed as part of the init function.

Which display are you using?

Re: Control of components from inside flowcode?

Posted: Sat Jul 07, 2012 6:35 pm
by cobra1
Hi Ben,

I am able to change the contrast when editing the init function, but that means i have to change the init function, then update the software to the chip for the settings to take effect.
What i would like to do is change the init function from a menu in the software.

Is this possible?

Oh the LCD is the Nokia 6610 LCD

Re: Control of components from inside flowcode?

Posted: Mon Jul 09, 2012 9:36 am
by Benj
Hi Cobra,

Can you use a Flowcode variable to hold the contrast setting eg contrast. Then customise the gLCD component init function to pass the value from FCV_CONTRAST into the contrast register. Once you have done this you simply have to put a value into the variable and then call the init function.