|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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;
}
}
|
|
#2
|
|||||
|
|||||
|
Re: Putdata(&txdata)
Quote:
|
|
#3
|
|||
|
|||
|
Re: Putdata(&txdata)
I dont know really, I thought I would just put it there to keep the same value just incase.
|
|
#4
|
||||
|
||||
|
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);
}
Last edited by cdawzrd : 20-02-2005 at 21:30. |
|
#5
|
|||
|
|||
|
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.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|