What hex command to invert text

Comments

5 comments

  • Saurabh_B

    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.

    0
  • andys

    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

    0
  • Saurabh_B

    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.

    0
  • gkearns

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

    Gord

    0
  • swadhin
    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;
    }
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    0

Please sign in to leave a comment.