Go to Post ...it takes a very special kind of person to equate bagpipes with harps. - Kevin Sevcik [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 21-01-2011, 15:39
DjMaddius's Avatar
DjMaddius DjMaddius is offline
Registered User
AKA: Matt Smith
FRC #2620 (Southgate Titans)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Southgate, Mi
Posts: 161
DjMaddius is an unknown quantity at this point
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?
Reply With Quote
  #2   Spotlight this post!  
Unread 21-01-2011, 15:48
davidalln's Avatar
davidalln davidalln is offline
World's Worst Coder
AKA: David Allen
FRC #2415 (The Westminster Wiredcats)
Team Role: Programmer
 
Join Date: Mar 2009
Rookie Year: 2008
Location: Atlanta, GA
Posts: 108
davidalln is on a distinguished road
Send a message via AIM to davidalln
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
__________________
SANTOSH ANDREW DECKER RICK WYNNIE SEAN DEREK MATT
(alamo (semis), p'tree (CHAMPS!), nc (CHAMPS!), newton (quarters))


Best four years of my life. Thanks to everyone who made it happen.
Reply With Quote
  #3   Spotlight this post!  
Unread 21-01-2011, 17:07
DjMaddius's Avatar
DjMaddius DjMaddius is offline
Registered User
AKA: Matt Smith
FRC #2620 (Southgate Titans)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Southgate, Mi
Posts: 161
DjMaddius is an unknown quantity at this point
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);
I get the error

Code:
error: argument of type `void (BuiltinDefaultCode::)(int)' does not match `int (*)(...)'
My function for the task is as follows:

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]'
with this line:
Code:
scissorLiftTaskArgs.solenoids = &m_solenoids;
Declarations of the two objects involved in the above error:
Code:
struct ScissorsLiftTaskStruct
	{
	     Solenoid *solenoids[(NUM_SOLENOIDS+1)];
	};

Solenoid *m_solenoids[(NUM_SOLENOIDS+1)];

Last edited by DjMaddius : 21-01-2011 at 17:16.
Reply With Quote
Reply


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 13:07.

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