I wish to convert my ADC data (uint16_t, 10bit data) to "int" so I can perform mathematical operations. Basically my goal is to make my version of "map" function in Arduino IDE, ex. int Value = map(ADC, 0, 1024, 0, 255);
So how can I convert uint16_t to int? Thank you in advance.
uint is converted to int automatically when making an assignment. This is a feature of the C language. Sized data types used in some libraries like uint16_t are just aliases of the generic C data types and should also undergo automatic conversion.