View Single Post
  #5   Spotlight this post!  
Unread 08-02-2008, 19:49
JBotAlan's Avatar
JBotAlan JBotAlan is offline
Forever chasing the 'bot around
AKA: Jacob Rau
FRC #5263
Team Role: Mentor
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Riverview, MI
Posts: 723
JBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond repute
Send a message via AIM to JBotAlan Send a message via Yahoo to JBotAlan
Re: Printf prints only the first character

OK, new strangeness...

I used to see this glitch only on lines that had variables in them. I now am getting single-character output from a line with no variables.

It always prints the first token; if I have a %d first thing, the number is printed, but often the rest of the string is absent.

Code:
PRESET #1 EDIT:
S-1
Wrist goal: 2
That's my output from this snippet:
Code:
	int loc_temp;
	printf("\r\nPRESET #%d EDIT:\r\n",(int)arg_preset);
	loc_temp = EEPROM_Read2ByteSigned(EEPROM_ADDRESS_PRESET_BASE + (arg_preset-1)*EEPROM_PRESET_LENGTH + EEPROM_PRESET_OFFSET_SHOULDER);
	printf("Shoulder goal: ");
	printf("%d\r\n",loc_temp);
	loc_temp = EEPROM_Read2ByteSigned(EEPROM_ADDRESS_PRESET_BASE + (arg_preset-1)*EEPROM_PRESET_LENGTH + EEPROM_PRESET_OFFSET_WRIST);
	printf("Wrist goal: ");
	printf("%d\r\n",loc_temp);
It seems to think it's done with the string. There are only Kevin Watson's ADC interrupts firing, and I have it set at 200Hz, so that should not be my problem. It also seems to be value-dependent. When I have negative values for the shoulder goal, it does print them, but the line before it gets truncated to first character.

This is getting stranger by the second.

JBot
__________________
Aren't signatures a bit outdated?