Integer to byte

You don't even have to worry about the values. The compiler will happily throw away all but the bottom 8 bits whan you store an integer value (short, int, long int, unsigned long int...) into a byte (unsigned char, uint8_t).