Page 1 of 1

maxBacklight

PostPosted: Tue Feb 23, 2016 3:56 pm
by AndrewB
I am using the Backlight PWM as an external PWM control as I have run out off ports etc.
Can I cap the default setting "public const maxBacklight = 1023" using a variable.

I would like to vary this max value real time.

Re: maxBacklight

PostPosted: Wed Feb 24, 2016 8:49 am
by David John Barker
I'm not quite sure what you mean. If you are saying you have changed the port the LCD backlight is on, then use high(pinX) to switch on and low(pinX) to switch off.

Re: maxBacklight

PostPosted: Wed Feb 24, 2016 9:36 am
by AndrewB
I would like to use Dogm as it already has min max limits.
What I was thinking of doing was to write to SetBacklight with a sensor value using the min and max settings.
But I would like to change the max and cap it.

I'm guessing that the routine are compiled in the programme anyway so may as well use them.
I can then visually view the pwm without having to add the hardware.

Re: maxBacklight

PostPosted: Wed Feb 24, 2016 10:43 am
by David John Barker
Personally, I would just cap the value going into SetBacklight(). However, the LCD module is open so feel free to hack it to fit your requirements. Before you do that, either (1) make a back up of the module or (2) copy the current module into your UserLibrary folder (C:\ProgramData\Mecanique\Firewing\UserLibrary). With option (2), you can change the module and it will be automatically linked into your main program. Importanly, it won't be overwritten should you perform a compiler update.

Re: maxBacklight

PostPosted: Wed Feb 24, 2016 11:49 am
by AndrewB
I've capped the data going in and not touching Dogm so probably leave it that way. Thanks