decimal value in uint8_t convert to the same decimal value in int

I have a decimal value 58 in my uint8_t but I need to make an int out of this.

Seemed straight forward to me, but apperantly this 58 is seen as hex and translated into 88 when it is in my int.

I just do now:
sensorArray*.value2 = Sensor->humidity; // where value2 is the int, and humidity the uint8_t.*
How can i do this so I get 58 in my int?

Why not post all your code.
A simple assignment should suffice.

I agree with AWOL. You need to post all of your code. How do you know that the value is changing from 58 to 88 when being assigned. The conversion make take place somewhere else, or may not be actually happening at all, depending on how the value is printed before and after the assignment.

It is fairly impossible to post all of my code as it is a huge project.

What I can say to help you is that this value comes out of a library in uint8_t and the sensor displays that it is 58.

I then cast it to int as you can see above and later I use my http connection to send it to a client using client.print(sensorArray.value2);

It appears that it is displayed well if I use client.print(sensorArray.value2, HEX); but that is not what i prefer, since it is a generic class and not all value2's are in this format.

What I can say to help you is that this value comes out of a library in uint8_t and the sensor displays that it is 58.

It seems bizarre that a humidity sensor has the ability to display a value at all. Which humidity sensor is it?

PaulS:

What I can say to help you is that this value comes out of a library in uint8_t and the sensor displays that it is 58.

It seems bizarre that a humidity sensor has the ability to display a value at all. Which humidity sensor is it?

Well not really, it is a cresta wireless 433 mhz thingy. Put that should not be the point.

Instead of having to use print(x,HEX), I would like to be able to just use print(x,DEC). So it seems that I do have to do some conversion, but how ? :slight_smile:

Instead of having to use print(x,HEX), I would like to be able to just use print(x,DEC).

Well, if it (whatever "it" is) is displaying 58 and you're using the HEX specifier, then printing in decimal will print 88.
Who says you "have" to use "print(x, HEX)"?

Put that should not be the point.

The point is this. Where is the 58 being displayed? If it is in your code, is the value being displayed using the HEX flag?