Newhaven Display Forum

Newhaven Products => OLEDs => Topic started by: andys on August 30, 2015, 03:45:56 PM

Title: What hex command to invert text
Post by: andys on August 30, 2015, 03:45:56 PM
Sorry, for the basic question...  but I couldn't quite make out what hex command needs to be sent to invert the text so "black on white" vs the normal "white" on black for a NHD-0420CW display.  I found the section in the datasheet, but didn't see how to form the hex command...  while I am at it, can you also give me the command to revert back to the normal mode?  I am using SPI communcations on an Arduino...

Finally, are there any Arduino menu libraries out there compatible with this display/controller.  I couldn't find one.

Thanks in advance
Andy
Title: Re: What hex command to invert text
Post by: Saurabh_B on August 31, 2015, 08:40:36 AM
Hi,

To invert the black/white for this display you would have to change the REV bit in the Function Set command, So if you send 0x2B, that should inverse the display. To set it back to normal you would want to send 0x2A, also to get back to the normal commands be sure to send the 0x28 to reset the RE bit.

Unfortunately we do not have any libraries for the controller.
Title: Re: What hex command to invert text
Post by: andys on August 31, 2015, 01:12:03 PM
Thanks!

So one quick followup question... will this invert the whole display?  Or just one line?

I was hoping to be able to invert a single line in order to distinguish it from other lines on the display.

Thanks
Andy
Title: Re: What hex command to invert text
Post by: Saurabh_B on August 31, 2015, 01:56:01 PM
This will invert the whole display. Unfortunately I don't think its possible to invert just 1 line of the display.

There is the option of creating custom characters, but you are limited to 8 characters, so depending on how many characters you would want inverted I would suggest going that route.
Title: Re: What hex command to invert text
Post by: gkearns@luxcom.com on November 26, 2015, 10:03:47 AM
Hi

I don't have a "Function Set" command in my list what hex value is that ?

Gord
Title: Re: What hex command to invert text
Post by: swadhin on November 26, 2015, 11:08:32 PM
hello admin,
I am using NHD-0216CW-AY3 lcd and interface to linux using i2c-smbus protocol.
from data sheet i can clear Display & DDRAM registors but please send me all the configuration that i can set the display 2 lines and crusor in home position. if possible please provide how to bring the display on.
Now using clearing display and Display on of command i'm getting some garbage value in display.
20H->00H and 20H->0F h
This is my function that i'm using to write in to the us2066 controller.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int lcd_write_cmd_data(unsigned char cmd, unsigned char val) {
        int ret;
        ret= smbus_i2c_init();
        if (ret<0) {
                printf("smbus_i2c_init() is failed\n");
        }
        ret= i2c_smbus_write_byte_data(fd, cmd ,val);
        if (ret < 0) {
                printf("failed writing register\n");
                return ret;
        }
        usleep(500);
        return 0;
}

int lcd_write_data(unsigned char val) {
        int ret;
        ret= smbus_i2c_init();
        if (ret<0) {
                printf("smbus_i2c_init() is failed\n");
        }
        ret= i2c_smbus_write_byte(fd, val);
        if (ret < 0) {
                printf("failed to write the value \n");
                return ret;
        }
        usleep(500);
        return 0;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////