The
%d format specifier wants to see an integer. The
rc_dig_in## values are being passed to
printf as chars. What you're seeing is the eight char values being printed as four int values.
To fix it, cast the switch values as ints.
Code:
rintf("rc_dig_in01: %d ... rc_dig_in08: %d\n", (int)rc_dig_in01 ... (int)rc_dig_in08);