Dimming Nextion displays with Arduino

I have to set the brightness of my nextion NX3224TO24, interfaced to the ESP8266 serial port. What is the command to set the dim variable with or without a library?

I answer myself:

Serial.print("dim=25");
Serial.write(0xff);
Serial.write(0xff);
Serial.write(0xff);

dim
dims Nextion
Backlight dim=32, dims=100
Sets the backlight level in percent
min 0, max 100, default 100 or user defined
Note: dim=32 will set the current backlight level to 32%.
using dims=32 will set the current backlight level to 32% and save this to be new power on default backlight level, persisting until changed.

skandy63:
I answer myself:

Serial.print("dim=25");
Serial.write(0xff);
Serial.write(0xff);
Serial.write(0xff);

That's right.
You have answer your self :slight_smile: :slight_smile:

please allow me

Serial.print("dim=25");
Serial.print("\xFF\xFF\xFF");

and you write only 2 lines