Probleme with changing array bit

i have Probleme with changing array bit how to put int to bite.

int last_axe_leftright = 20;

byte cam_left[9]= {0x81, 0x01, 0x06, 0x01, 0x10, 0x01, 0x01, 0x03, 0xFF};

cam_left[5] = '0x'.axe_leftright_speed;

my problem i want this but im not able

byte cam_left[9]= {0x81, 0x01, 0x06, 0x01, 0x20, 0x01, 0x01, 0x03, 0xFF};

thank you sorry for my english im french guy

I am not sure I understand, but this is what it appears to be to me.

int last_axe_leftright = 20; // In decimal or hex???

Set an integer value equal to 20 in decimal. Define a byte array:

byte cam_left[9]= {0x81, 0x01, 0x06, 0x01, 0x10, 0x01, 0x01, 0x03, 0xFF};

Now change element 5 of the cam_left[] array to the value 20, so the array now appears as:

byte cam_left[9]= {0x81, 0x01, 0x06, 0x01, 0x20, 0x01, 0x01, 0x03, 0xFF};

Several things. First, did you mean:

int last_axe_leftright = 0x20; // This is hex rather than decimal

Next, in C, arrays start with element zero, not 1. So, perhaps you want to do this:

cam_left[4] = last_axe_leftright;

which would change the cam_left[] array to:

byte cam_left[9]= {0x81, 0x01, 0x06, 0x01, 0x20, 0x01, 0x01, 0x03, 0xFF};

thanks

int last_axe_leftright = 20;

i define this because when i start the arduino a want 20 but
afater last_axe_leftright change with potentiometer

int last_axe_leftright= analogRead(A0)/43;

my problem is last_axe_leftright is inter from value analog read but i want byte.
it a reason i ad '0x'+(last_axe_leftright)

cam_right[5] = '0x'+(last_axe_leftright);

but i dont work thank for your anwser

cam_right[5] = last_axe_leftright;

(We also have a francophone section of the forum)