everyone! I'm trying to become familiar with TinyOS. I'd like to know the difference between uint8_t and uint16_t.
Thank you in advance :-)
Just for the sake of thoroughness:
Data types come in many shapes and sizes. The two you are referring to are of types unsigned 8 bit integer
and unsigned 16 bit integer
.
An integer is a whole number that can be positive or negative; however, in the case of types an unsigned integer can only be positive as it does not designate space for a sign (i.e. a negative sign). 8 bit and 16 bit refer to the amount of space the integer takes up in memory. An unsigned 8 bit integer
's values can be 0 - 255 while an unsigned 16 bit integer can hold values from 0 - 65,535 (Side note: If you are familiar with networking you may notice that 65,535 is the largest port number possible. This is due to the fact a port number is an unsigned 16 bit integer
.)
Hope this helps.