Author Topic: What hex command to invert text  (Read 2547 times)

andys

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
What hex command to invert text
« 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

Saurabh_B

  • Administrator
  • Hero Member
  • *****
  • Posts: 338
  • Karma: 10
    • View Profile
Re: What hex command to invert text
« Reply #1 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.

andys

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
Re: What hex command to invert text
« Reply #2 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

Saurabh_B

  • Administrator
  • Hero Member
  • *****
  • Posts: 338
  • Karma: 10
    • View Profile
Re: What hex command to invert text
« Reply #3 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.

gkearns@luxcom.com

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Re: What hex command to invert text
« Reply #4 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

swadhin

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
Re: What hex command to invert text
« Reply #5 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;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

NHD‐0420CW‐AG3: blinking part of text?

Started by RichardRBoard OLEDs

Replies: 2
Views: 2138
Last post February 28, 2017, 03:27:02 PM
by BobG
Text orientation not changing with Extended Entry Mode Set Register

Started by tekknojoeBoard OLEDs

Replies: 5
Views: 1253
Last post January 27, 2017, 10:13:57 AM
by jmadsenee
NHD-0216CW-AY3 8-bit Parallel 8080, Text on Display Issue

Started by forteyBoard OLEDs

Replies: 14
Views: 7035
Last post March 09, 2015, 02:23:51 PM
by Retheesh_M
MOVED: NHD-0420CW-AY3 display, text is mirror image

Started by Saurabh_BBoard Character LCDs

Replies: 0
Views: 1956
Last post March 11, 2016, 07:51:03 AM
by Saurabh_B
NHD-0420CW-AY3 display, text is mirror image

Started by zleozBoard OLEDs

Replies: 1
Views: 1816
Last post March 11, 2016, 07:59:53 AM
by Paul_B