|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Tasks Question
Iv got a task running and i have a problem.
I cant control anything that isnt static, like solenoids and such. Any way around this? |
|
#2
|
||||
|
||||
|
Re: Tasks Question
I'm not exactly positive what you're asking, but this thread might help you out: http://www.chiefdelphi.com/forums/sh...=task+tutorial
|
|
#3
|
||||
|
||||
|
Re: Tasks Question
Thanks, that helped quite a bit.
Though now im having a separate problem with it. When i declate the task: Code:
Task scissorLiftTask("Scissor Lift Task", (FUNCPTR)scissorMovePos);
Code:
error: argument of type `void (BuiltinDefaultCode::)(int)' does not match `int (*)(...)' Code:
void scissorMovePos(int argPtr)
{
ScissorsLiftTaskStruct* args = (ScissorsLiftTaskStruct*)argPtr;
while(true)
{
if(curPOS != POS)
{
switch(POS)
{
case 0: // DOWN
args->solenoids[1]->Set(true);
break;
case 1: // SIDE HIGH
break;
case 2: // SIDE MID
break;
case 3: // SIDE LOW
break;
case 4: // MID LOW
break;
case 5: // MID MID
break;
case 6: // MID HIGH
break;
default: // DOWN
break;
}
curPOS = POS;
}
}
}
EDIT:; Also, im getting this error: Code:
error: incompatible types in assignment of `Solenoid* (*)[9]' to `Solenoid*[9]' Code:
scissorLiftTaskArgs.solenoids = &m_solenoids; Code:
struct ScissorsLiftTaskStruct
{
Solenoid *solenoids[(NUM_SOLENOIDS+1)];
};
Solenoid *m_solenoids[(NUM_SOLENOIDS+1)];
Last edited by DjMaddius : 21-01-2011 at 17:16. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|