how to set threshold with pot, to print hex over rs232 to adjust TV brightness

Hello

I'm trying to make a very simple (but complicated for me) program to adjust the brightness/backlight of various screens that have RS232 connection.

The idea is 2 buttons, for on and off (standby) and 1 potentiometer to adjust TV brightness.
When the brightness would be adjusted, I want it to have 20 thresholds
F.x. if the pot value is less than 50, the arduino would adjust the brightness to 5%
If the value would then change to 50 - 100, another msg would be sent to adjust brightness to 10%
And after sending the fixed HEX msg, I'd like it to pause untill the pot value changes to another "threshold"

I have all the cables needed, the HEX msgs from the manufacturer but almost no knowledge in programming nor terms and have no idea what to look for, hence why I'm posting here.

If anyone could guide me to the right "articles" that would be really appriciated, or give me a few examples that I could stitch together.

Thanks in advance for any help I can get :sweat_smile:

I have all the cables needed, the HEX msgs from the manufacturer but almost no knowledge in programming nor terms and have no idea what to look for, hence why I'm posting here.

You need to post a lot more information that you are holding back - the HEX codes, the type of screen, etc., etc.

Is this your first project? If so, bad idea. You should try a lot more simple stuff to get up to speed.

Ah, yes ofcourse, here’s a list of HEX code for brightness adjustment and ON/OFF

Neovo QX-43 PID control	
	
On	A6 01 00 00 00 04 01 18 02 B8 
Off	A6 01 00 00 00 04 01 18 01 BB 
	
0%	A6 01 00 00 00 04 01 C0 00 62 
5%	A6 01 00 00 00 04 01 C0 05 67 
10%	A6 01 00 00 00 04 01 C0 0A 68 
15%	A6 01 00 00 00 04 01 C0 0F 6D 
20%	A6 01 00 00 00 04 01 C0 14 76 
25%	A6 01 00 00 00 04 01 C0 19 7B 
30%	A6 01 00 00 00 04 01 C0 1E 7C 
35%	A6 01 00 00 00 04 01 C0 23 41 
40%	A6 01 00 00 00 04 01 C0 28 4A 
45%	A6 01 00 00 00 04 01 C0 2D 4F 
50%	A6 01 00 00 00 04 01 C0 32 50 
55%	A6 01 00 00 00 04 01 C0 37 55 
60%	A6 01 00 00 00 04 01 C0 3C 5E 
65%	A6 01 00 00 00 04 01 C0 41 23 
70%	A6 01 00 00 00 04 01 C0 46 24 
75%	A6 01 00 00 00 04 01 C0 4B 29 
80%	A6 01 00 00 00 04 01 C0 50 32 
85%	A6 01 00 00 00 04 01 C0 55 37 
90%	A6 01 00 00 00 04 01 C0 5A 38 
95%	A6 01 00 00 00 04 01 C0 5F 3D 
100%	A6 01 00 00 00 04 01 C0 64 06

here the monitor type is Neovo QX-43, and has a serial connection on the back.

I’m okay with this being difficult since this is the first project I’ve wanted to do in a long time, other projects where school related, many years ago.

Just to bump the post. ::slight_smile:

I've been trying to figure out how to post the HEX "simply" over serial transmission, without luck.

Here's the code I've been trying, to get some hex through serial
//New hexcode used since it'S for another type of NEOVO screen, same com port settings

byte message[] = {0xA6, 0x01, 0x00, 0x00, 0x00, 0x04, 0x01, 0xc0, 0x00, 0x62 }; // 10% backlight for neovo rx-22G
byte message10[] = {0xA6, 0x01, 0x00, 0x00, 0x00, 0x04, 0x01, 0xc0, 0x64, 0x06 }; // 100% backlight for neovo rx-22G

void setup()
{
  pinMode(A1, INPUT);
  Serial.begin(9600);

}

void loop() {
  int sensorValue = analogRead(A1);

  if ( sensorValue < 100)
  {
    delay(100);
    Serial.write(message, sizeof(message));
    Serial.println();
    //While loop created so the program doesn't send message more than once per backlight adjustment
    while (sensorValue < 100)
    {
      delay(500);
      sensorValue = analogRead(A1);
    }
  }
  else if (sensorValue > 101 && sensorValue < 200)
  {
    delay(100);
    Serial.write(message10, sizeof(message10));
    Serial.println();
    while (sensorValue > 101 && sensorValue < 200)
    {
      delay(500);
      sensorValue = analogRead(A1);
    }
  }
}

I've used a program called Hercules 232 to send HEX command to adjust the computer monitor and view the port to see what goes through.
In attached you can see 2 commands, upper one is sent as a HEX command, lower as an ascii (I think) command.

The upper one works to adjust the monitor.