View Single Post
  #2   Spotlight this post!  
Unread 16-01-2008, 18:54
psy_wombats's Avatar
psy_wombats psy_wombats is offline
Registered User
AKA: A. King
FRC #0467 (Duct Tape Bandits)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Shrewsbury MA
Posts: 95
psy_wombats has a spectacular aura aboutpsy_wombats has a spectacular aura aboutpsy_wombats has a spectacular aura about
Re: printf causes programs to not run

The fast loop, I believe, can't support the printf function, simply because it is a very fast loop. The printf takes a lot of time (relaying info through your serial) so the print is being called way too fast for it to finish, and causes the program error.

Should be able to fix by calling only by a timer interrupt, or when a loop count is divisible by fifty, (to call every fiftieth loop or something), or maybe use the slow loop?