Byte variable

goodmorning everybody,
how can I assign the value read by a sensor that is 3 bytes long three variablili Byte different ?
then I have to add two of these variables and then convert them to integer values

ITALIANO

buon giorno a tutti!!,
come faccio ad assegnare il valore letto da un sensore che è lungo 3 Byte a tre variablili Byte differenti?
successivamente devo sommare due di queste variabili per poi convertirle in valori interi

thank you very much

unsigned long val = (((unsigned long)a) << 16) | (((unsigned long)b) << 16) | c;

where a, b, c are your byte values.

AWOL:

unsigned long val = (((unsigned long)a) << 16) | (((unsigned long)b) << 16) | c;

where a, b, c are your byte values.

I suppose you mean:

unsigned long val = (((unsigned long)a) << 16) | (((unsigned long)b) << 8) | c;

if I read the value with this function:

#define Dat 5
#define Clk 6

shiftIn(Dat, Clk, MSBFIRST);

how can i do this??.. sorry but i’m a beginner with arduino…

it return a data stream: 00000010101100110101000100000000
/-----------------------------------/
4 byte
/-------/--------/--------/---------/
1°temp 2°temp humi CRC
I have to share this information and add the first to the second and then i subtract 400.
finally i have the temperature, the humidity and the CRC…
please help me
thankyou very much

because i read this value from a sensor (7719 termoigrosens).

see your other thread. (end this one)

I reply you in the other thread