uint8_t is the type your looking for. It makes no sense to define a type with 7 bits as it would use 8 bits anyway. 2 and 4 bits could be stored as bits within uint8_t but that involves programming overhead every time you access the value so you have to decide for yourself if it's worth it or if you just use the bigger type and use a bit more memory.