Go to Post Blasphemy! Everyone knows Mountain Dew is roboteer fuel. - Racer26 [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 16-02-2004, 14:28
Catastrophy Catastrophy is offline
Registered User
AKA: Vince
#0704
Team Role: Programmer
 
Join Date: Feb 2004
Location: Grand Prairie
Posts: 18
Catastrophy is an unknown quantity at this point
Send a message via AIM to Catastrophy Send a message via MSN to Catastrophy
Re: Odd counter problems

ok I did and now theres nothing there, its not printing anything.
  #2   Spotlight this post!  
Unread 16-02-2004, 14:33
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: Odd counter problems

Quote:
Originally Posted by Catastrophy
ok I did and now theres nothing there, its not printing anything.
Hum, well, try just using the following line. It's guarranteed to print and if it doesn't, it means that it is never getting called and you'll have to look at your code.

Code:
printf("Test");

--EDIT--
If it doesn't work then post your code and people can look at it.
__________________

  #3   Spotlight this post!  
Unread 16-02-2004, 14:44
Catastrophy Catastrophy is offline
Registered User
AKA: Vince
#0704
Team Role: Programmer
 
Join Date: Feb 2004
Location: Grand Prairie
Posts: 18
Catastrophy is an unknown quantity at this point
Send a message via AIM to Catastrophy Send a message via MSN to Catastrophy
Re: Odd counter problems

It printed test but here it is. I'm using a basic auto right now so i can debug everything first.
Attached Files
File Type: txt New Text Document.txt (6.2 KB, 33 views)
  #4   Spotlight this post!  
Unread 16-02-2004, 14:54
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: Odd counter problems

Quote:
Originally Posted by Catastrophy
It printed test but here it is. I'm using a basic auto right now so i can debug everything first.
What exactly is the output say? Does the 'arm value of armcounter' print anything? What does it print?

--EDIT--
Try changing the %i in the printf to %d.
__________________

  #5   Spotlight this post!  
Unread 16-02-2004, 15:50
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,576
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Odd counter problems

Quote:
Originally Posted by Texan
Try changing the %i in the printf to %d.
Remeber that IFI implemented printf and that it isn't a "standard" implementation. Only the %s, %lx, %d, %x, %u, %X directives are parsed.

Catastrophy, is your problem fixed now that it is counting, or do you have more problems?
  #6   Spotlight this post!  
Unread 16-02-2004, 15:58
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: Odd counter problems

Quote:
Originally Posted by Joe Ross
Remeber that IFI implemented printf and that it isn't a "standard" implementation. Only the %s, %lx, %d, %x, %u, %X directives are parsed.

Catastrophy, is your problem fixed now that it is counting, or do you have more problems?
Oh, didn't know those limitations. Thanks
__________________

  #7   Spotlight this post!  
Unread 16-02-2004, 16:14
Catastrophy Catastrophy is offline
Registered User
AKA: Vince
#0704
Team Role: Programmer
 
Join Date: Feb 2004
Location: Grand Prairie
Posts: 18
Catastrophy is an unknown quantity at this point
Send a message via AIM to Catastrophy Send a message via MSN to Catastrophy
Re: Odd counter problems

well the motors still arnt stopping.
  #8   Spotlight this post!  
Unread 16-02-2004, 16:40
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,576
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Odd counter problems

Quote:
Originally Posted by Catastrophy
well the motors still arnt stopping.
Please post the code that you are using currently.

If you are using the corrections that Rob posted, pwm06 will go forward for about 1/3 a second and then go in reverse forever. You also have a similar behavior for pwm07 (assuming you corrected the errors)
  #9   Spotlight this post!  
Unread 16-02-2004, 14:57
rbayer's Avatar Unsung FIRST Hero
Happy Birthday! rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
Re: Odd counter problems

A few things I saw after glancing at it:
Code:
if (armcounter = 15) //will raise arm.
   pwm06=0;
else 
   armcounter++;
   pwm06=255;
sould be
Code:
if (armcounter == 15) //will raise arm.
   pwm06=0;
else {
   armcounter++;
   pwm06=255; 
}
It is VERY rare that you'll actually want to use a single = in an if, so watch out for that, and also be careful with your curly braces.

That said, I believe the code in its original form should have printf'd 15 over and over and over. Was it doing that, or just not printing anything?
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
  #10   Spotlight this post!  
Unread 16-02-2004, 15:03
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: Odd counter problems

Quote:
Originally Posted by rbayer
A few things I saw after glancing at it:
Code:
if (armcounter = 15) //will raise arm.
   pwm06=0;
else 
   armcounter++;
   pwm06=255;
sould be
Code:
if (armcounter == 15) //will raise arm.
   pwm06=0;
else {
   armcounter++;
   pwm06=255; 
}
It is VERY rare that you'll actually want to use a single = in an if, so watch out for that, and also be careful with your curly braces.

That said, I believe the code in its original form should have printf'd 15 over and over and over. Was it doing that, or just not printing anything?
Missing a = is an easy thing to do. It's one of those powerful, useful things that C/C++ lets you do, but isn't what you want most of the time.
__________________

  #11   Spotlight this post!  
Unread 16-02-2004, 15:08
Catastrophy Catastrophy is offline
Registered User
AKA: Vince
#0704
Team Role: Programmer
 
Join Date: Feb 2004
Location: Grand Prairie
Posts: 18
Catastrophy is an unknown quantity at this point
Send a message via AIM to Catastrophy Send a message via MSN to Catastrophy
Re: Odd counter problems

Well the = was something i accidently did when moving it i had it in the code i was using. and btw its just not printing anything.
  #12   Spotlight this post!  
Unread 16-02-2004, 15:09
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: Odd counter problems

Quote:
Originally Posted by Catastrophy
Well the = was something i accidently did when moving it i had it in the code i was using. and btw its just not printing anything.
So, the "test" prints, but the other thing doesn't?
__________________

  #13   Spotlight this post!  
Unread 16-02-2004, 17:10
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: Odd counter problems

Quote:
Originally Posted by rbayer
A few things I saw after glancing at it:
Code:
if (armcounter = 15) //will raise arm.
   pwm06=0;
else 
   armcounter++;
   pwm06=255;
sould be
Code:
if (armcounter == 15) //will raise arm.
   pwm06=0;
else {
   armcounter++;
   pwm06=255; 
}
It is VERY rare that you'll actually want to use a single = in an if, so watch out for that, and also be careful with your curly braces.

That said, I believe the code in its original form should have printf'd 15 over and over and over. Was it doing that, or just not printing anything?
remember that you need to add the curly braces, not just change the equals sign to a double-equals. w/o the braces, the code is equivalent to this:

Code:
if (armcounter == 15) //will raise arm.
   pwm06=0;
else {
   armcounter++; 
}

pwm06=255;
note how pwm06 will always end up as 255, no matter what the value is.

you said that the "motors weren't stopping" - of course they aren't: 0 is full reverse, 255 is full forward. if you want a motor to stop, set the PWM to 127.
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)
  #14   Spotlight this post!  
Unread 16-02-2004, 23:41
Catastrophy Catastrophy is offline
Registered User
AKA: Vince
#0704
Team Role: Programmer
 
Join Date: Feb 2004
Location: Grand Prairie
Posts: 18
Catastrophy is an unknown quantity at this point
Send a message via AIM to Catastrophy Send a message via MSN to Catastrophy
Re: Odd counter problems

Well i got it working i was messign with the code when i posted it so i accidently left stuff out. Thanks Tex helped a lot.
  #15   Spotlight this post!  
Unread 16-02-2004, 15:09
steven114 steven114 is offline
Programming Wizard and Team Captain
AKA: Steven Schlansker
FRC #0114 (Eaglestrike)
Team Role: Programmer
 
Join Date: Feb 2004
Location: Los Altos, CA
Posts: 335
steven114 is a jewel in the roughsteven114 is a jewel in the roughsteven114 is a jewel in the rough
Send a message via AIM to steven114
Re: Odd counter problems

Quote:
Originally Posted by Texan
Hum, well, try just using the following line. It's guarranteed to print and if it doesn't, it means that it is never getting called and you'll have to look at your code.

Code:
printf("Test");

--EDIT--
If it doesn't work then post your code and people can look at it.
Try
Code:
printf("Test\n");
instead. If it works anything like printf on any other system, it won't flush the buffer until it gets a newline...
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
Meeting FIRST People in odd places Jeff Waegelin General Forum 219 04-03-2012 13:10
Do you all have problems with.... Munkaboo Website Design/Showcase 19 03-03-2003 19:51
Joystick problems archiver 2001 3 24-06-2002 02:40
A couple of problems I observed at the MAR archiver 2000 3 23-06-2002 22:27
Radio problems -- not archiver 2000 1 23-06-2002 22:23


All times are GMT -5. The time now is 05:59.

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