gLCD SendCommand() help?

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
chad
Posts: 198
Joined: Sun Nov 04, 2018 7:13 pm
Has thanked: 27 times
Been thanked: 33 times
Contact:

gLCD SendCommand() help?

Post by chad »

Hello All.

I just got a new color 128x128 oled display(nice display). It uses the ssd1351 component.

I have been playing with sending commands to it using SendCommand(). For instance SendCommand(174) turns off the display 175 turns it on. Some of the stuff isn't supported in the component so I am trying to do it manually.

There is a command that 'Set Contrast Current for Color A,B,C (C1h)' This is DEC:193. I can send that using the above SendCommand() but it needs a BYTE to follow. I tried using the SendData right after but it doesn't work.

Does anyone know how to send a command 193 and include the BYTE afterword?? There is no ref in any of the help and the wiki has nothing on it..

thanks,

chad

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: gLCD SendCommand() help?

Post by LeighM »

Have you tried two SendCommand()?

chad
Posts: 198
Joined: Sun Nov 04, 2018 7:13 pm
Has thanked: 27 times
Been thanked: 33 times
Contact:

Re: gLCD SendCommand() help?

Post by chad »

Yeah, I tried that too..

Chad

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: gLCD SendCommand() help?

Post by Benj »

Hi Chad,

We do this type of thing in the component and it simply calls the command followed by the data functions.

Code: Select all

    FCD_0ae81_gLCD_SSD1351__SendCommand(0xFD);
    FCD_0ae81_gLCD_SSD1351__SendData(0x12);

    FCD_0ae81_gLCD_SSD1351__SendCommand(0xFD);
    FCD_0ae81_gLCD_SSD1351__SendData(0xB1);
The display datasheets are often far from helpful, maybe try and find some example C code for setting the contrast as you may have to do additional things to get any real variation.

chad
Posts: 198
Joined: Sun Nov 04, 2018 7:13 pm
Has thanked: 27 times
Been thanked: 33 times
Contact:

Re: gLCD SendCommand() help?

Post by chad »

HI Ben, Happy new year!

I'll give that a try. Thanks!

EDIT* How do I use that command? I tried it as c and it errors out.
EDIT*2 Ok, that demo was for the non spi version of that component. I found the correct call for the component and it compiles now.
Still doesn't work. This is what I am trying to do:

10.1.20 Set Contrast Current for Color A,B,C (C1h)
This command is used to set Contrast Setting of the display. The chip has 256 contrast steps from 00h to FFh.
The segment output current ISEG increases linearly with the contrast step, which results in brighter display.
I am trying to dim the display.


chad

Post Reply