View Single Post
  #2   Spotlight this post!  
Unread 06-03-2006, 07:32
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Odd Problem With Old EDU Bot

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);