Adjustment of Contrast in C#, differences netdc8 / picocom2

  • Hello


    here is a VS2008 CF35 sample how to adjust contrast under Windows CE, in C# written.
    The sample has a trackbar to change current contrast value, the button is used to store it permanent in registry. Registry value is loaded to the trackbar after init.


    I tested it with Netdcu8 and it works. Values are changing expected and are stored permanent in registry and are used after device power off.


    But for Picomod2 I got different behavoiur, sometimes the display goes black when trackbar is used and the reslution (should be 0..4095) is also not the same. Nearly only 3 values are to see: bright , a bit less bright and black display.
    When i look in the registry after a picocom2 trackbar change(whithout pressing the button), the value is not the value from the trackbar(0..4095) but something undefined. Lets´s say I change trackbar from 0 to 200, the value in the registry is may be 24 or whatever but not 200.


    I use a Hitachi TX09 320x240 LCD.
    Can anybody see any errors here in coding or thinking?
    I need one and the same software to running on both devices netdc8 and picocom2.



    bye
    Andreas

  • [admin edit: Moved into PicoCOM->PicoCOM2 forum]


    I suppose this is a problem of the different ranges used for adjusting the contrast voltage on NetDCU8 and PicoCOM2. On NetDCU8 the range is from 0 to 0x3FF. On PicoCOM2 instead the range goes from 0 to 0xFF. Unfortunatly the basic contrast example we are providing is not that clear in this case.
    You can get the range by using the escape function code CONTRAST_CMD_MAX (defined in PWINGDI.H).

    Software developer, F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Hello


    Yes now it is clear. I got it working, but netdcu8 has range up 4095 not ox3ff!
    This is the neccesary additional code for c# if anybody needs it:



    bye
    Andreas