Go to Post Are we really at the point where the only useful thing we can discuss is Dean's choice in timekeeping apparel? The man has a watch. He uses it to tell time. Do we really care how much it is worth, or who made it? I would be much more interested in what he does, not what he wears. - dlavery [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 20-02-2005, 19:59
SpeakerSilenced SpeakerSilenced is offline
Programming/Electrical Team Member
#0219 (Team Impact)
Team Role: Programmer
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Hackettstown, NJ
Posts: 28
SpeakerSilenced is an unknown quantity at this point
Send a message via AIM to SpeakerSilenced
Putdata(&txdata)

Do I need to call Putdata(&txdata); everytime I want a PWM value (1-7) to move the motor? and can I call it anytime it changes or are there specific times i can only call it?

I have various loops inside the autonomous loop
Here is a small one
Code:
while (movefoward = 1)
		{
			pwm03 = pwm03;
			pwm01=130;
			pwm02=130;
			Putdata(&txdata);
			fowardcounter++;
			if (fowardcounter > amountfoward) //If this has moved for amountfoward loops then stop
			{
				movefoward = 0;
			}
		}
can I do that in order to have those values executed? or do i need to do it another way
__________________
"I want to put a ding in the universe" - Steve Jobs
  #2   Spotlight this post!  
Unread 20-02-2005, 20:44
Unsung FIRST Hero
Greg Marra Greg Marra is offline
[automate(a) for a in tasks_to_do]
FRC #5507 (Robotic Eagles)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2005
Location: San Francisco, CA
Posts: 2,031
Greg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond repute
Re: Putdata(&txdata)

Quote:
Originally Posted by SpeakerSilenced
Code:
while (movefoward = 1)
		{
			pwm03 = pwm03;
			...
		}
I don't know the answer to your question, but I suspect it might be 'no'. May I just ask what 'pwm03 = pwm03;' is there for? It seems kind of redundant.
  #3   Spotlight this post!  
Unread 20-02-2005, 20:57
SpeakerSilenced SpeakerSilenced is offline
Programming/Electrical Team Member
#0219 (Team Impact)
Team Role: Programmer
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Hackettstown, NJ
Posts: 28
SpeakerSilenced is an unknown quantity at this point
Send a message via AIM to SpeakerSilenced
Re: Putdata(&txdata)

I dont know really, I thought I would just put it there to keep the same value just incase.
__________________
"I want to put a ding in the universe" - Steve Jobs
  #4   Spotlight this post!  
Unread 20-02-2005, 21:24
cdawzrd's Avatar
cdawzrd cdawzrd is offline
Vice-President of Caffine
AKA: Jonathan
#0619 (CA Robotics)
Team Role: Programmer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Charlottesville, Virginia
Posts: 63
cdawzrd will become famous soon enough
Send a message via AIM to cdawzrd
Re: Putdata(&txdata)

while (movefoward = 1)
this is an infinite loop!
you want
while(moveforward == 1). "==" checks for equality. "=" assigns a variable.

I belive you have to call PutData all the time, it lets the master processor know the user processor is still alive. Someone who knows more about the IFI stuff can tell you for sure. I would call it every loop.

Edit: Call the PutData function once per loop. So, you have
Code:
void User_Autonomous_Code(void)
{
Getdata(&rxdata); 
//do whatever
Putdata(&txdata);
}
So every loop, you get data and put it. The master processor will not let the system work if you don't execute Getdata and Putdata once every loop, but only once! Only call putdata at the very end of every Autonomous loop, so you edit your pwm values and do your calculations, then the very last thing is to Putdata.
__________________
Cdawzrd
>> www.cdawzrd.com <<
>> www.carobotics.org <<

Last edited by cdawzrd : 20-02-2005 at 21:30.
  #5   Spotlight this post!  
Unread 20-02-2005, 21:51
SpeakerSilenced SpeakerSilenced is offline
Programming/Electrical Team Member
#0219 (Team Impact)
Team Role: Programmer
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Hackettstown, NJ
Posts: 28
SpeakerSilenced is an unknown quantity at this point
Send a message via AIM to SpeakerSilenced
Re: Putdata(&txdata)

Oh, alright... that is going to require a lot of code editing then -_- thanks for finding that error on the assignment I forgot about that.
__________________
"I want to put a ding in the universe" - Steve Jobs
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


All times are GMT -5. The time now is 00:15.

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