Go to Post My strongest FIRST memories, and the teams that leave the biggest impact on me, are teams that seem like they have every reason to give up, but never do. - Chris is me [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 31-01-2008, 22:57
Maxpower57's Avatar
Maxpower57 Maxpower57 is offline
Fabuloso
AKA: Maxwell V.
FRC #2574 (RoboHuskie)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2008
Location: St. Anthony, MN
Posts: 53
Maxpower57 will become famous soon enoughMaxpower57 will become famous soon enough
Send a message via AIM to Maxpower57
Newline broken?

Ok, so for some odd reason (personally, i blame the crappy mplab compiler)
the newline \n key has stopped working in the printf commands..

im confused at how this is even possible

printf("test \n");

any ideas?
  #2   Spotlight this post!  
Unread 31-01-2008, 22:59
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
Re: Newline broken?

I know it's odd, and not right, but return is the character you're looking for

Code:
printf("adaptive cruise setpoint: %d\r",lvel.cruise);
-q
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08
  #3   Spotlight this post!  
Unread 31-01-2008, 23:00
Maxpower57's Avatar
Maxpower57 Maxpower57 is offline
Fabuloso
AKA: Maxwell V.
FRC #2574 (RoboHuskie)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2008
Location: St. Anthony, MN
Posts: 53
Maxpower57 will become famous soon enoughMaxpower57 will become famous soon enough
Send a message via AIM to Maxpower57
Re: Newline broken?

Quote:
Originally Posted by Qbranch View Post
I know it's odd, and not right, but return is the character you're looking for

Code:
printf("adaptive cruise setpoint: %d\r",lvel.cruise);
-q
o rly? wow. ok thanks.
i thought i remember the newline working before...
eh oh well... way to follow the C standard MPlab.. </sarcasm>
  #4   Spotlight this post!  
Unread 01-02-2008, 02:23
whitetiger0990's Avatar
whitetiger0990 whitetiger0990 is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Mar 2006
Rookie Year: 2006
Location: Earth
Posts: 157
whitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of light
Re: Newline broken?

It depends on what you're using to view it. On Windows, line endings are \r\n (A carriage return and a linefeed). Just a \r is incorrect, but I don't complain if it works. Linux is just a \n, nuff said. I think IFI Loader's viewing thing wants a \r\n (or at least an \r) and the Hyperterminal just wants an \n... or maybe it was the other way around. It has nothing to do with c18 or mplab, it has to do with the client you're using to view it. c18 doesn't care what it's sending. =)

http://en.wikipedia.org/wiki/End_of_line
__________________
print$q=chr(ord($q)+$1)while("7443-0201-8465130105-12-03135-82482113-06-7672-070208-0613-70"=~/(-?\d\d)/g);
  #5   Spotlight this post!  
Unread 01-02-2008, 10:59
jgannon's Avatar
jgannon jgannon is offline
I ᐸ3 Robots
AKA: Joey Gannon
no team
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Pittsburgh, PA
Posts: 1,467
jgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond repute
Re: Newline broken?

Quote:
Originally Posted by whitetiger0990 View Post
Just a \r is incorrect
As it turns out, \r has traditionally been the standard for Macintosh. I don't know whether that has changed since Mac OS became more Unix-y. In any case, you're right that this problem has far less to do with C18 than it does with the program you're using to view your output.
__________________
Team 1743 - The Short Circuits
2010 Pittsburgh Excellence in Design & Team Spirit Awards
2009 Pittsburgh Regional Champions (thanks to 222 and 1218)
2007 Pittsburgh Website Award
2006 Pittsburgh Regional Champions (thanks to 395 and 1038)
2006 Pittsburgh Rookie Inspiration & Highest Rookie Seed

Team 1388 - Eagle Robotics
2005 Sacramento Engineering Inspiration
2004 Curie Division Champions (thanks to 1038 and 175)
2004 Sacramento Rookie All-Star

_
  #6   Spotlight this post!  
Unread 01-02-2008, 11:26
whitetiger0990's Avatar
whitetiger0990 whitetiger0990 is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Mar 2006
Rookie Year: 2006
Location: Earth
Posts: 157
whitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of light
Re: Newline broken?

Quote:
Originally Posted by jgannon View Post
As it turns out, \r has traditionally been the standard for Macintosh. I don't know whether that has changed since Mac OS became more Unix-y. In any case, you're right that this problem has far less to do with C18 than it does with the program you're using to view your output.
Oh hm, you're right, according to the wiki article I linked to it was used pre-OS X.

Personally I like just a \n, even though \r\n matches up with history. Prior to nice monitors, people used line printers. A \n would feed paper. (It's actually called a Line Feed.) \r moved the printer carriage back to the left. Thus a \r\n positions it at the beginning of the next line, then we stopped using printers , and it was kept for compatibility reasons, and now no one should be using a line printers anymore... even though that'd be awesome.
__________________
print$q=chr(ord($q)+$1)while("7443-0201-8465130105-12-03135-82482113-06-7672-070208-0613-70"=~/(-?\d\d)/g);
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Camera broken Muffinman Electrical 2 01-02-2007 10:25
Broken O/I NumberQ Robotics Education and Curriculum 10 01-10-2004 16:06
CD is broken. Rickertsen2 CD Forum Support 62 26-10-2003 13:06
Broken Gears? archiver 2001 2 24-06-2002 01:54
Broken promises or BROKEN ROBOTS! archiver 1999 9 23-06-2002 22:18


All times are GMT -5. The time now is 19:11.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi