Go to Post You win Worlds by innovation. You win Worlds by determination. You win Worlds by engineering a robot so solid, that it successfully completes the game. - Zach O [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 07-02-2012, 19:33
agartner01 agartner01 is offline
Captain + Control Sys & Design
FRC #4174
Team Role: Engineer
 
Join Date: Feb 2012
Rookie Year: 2012
Location: Hector MN
Posts: 109
agartner01 is an unknown quantity at this point
How to use tasks

I read the task section in the WPILib manual and the class help file, but when I'm having difficulty getting anything working. The example I'm giving has everything extra cut out. (spelling and code punctuation might not be right)

Code:
class 4174robot : public InterativeRobot
{
public:
4174robot();
...(Interative Robot Overrides)...
void TestTaskFunction();
...
private:
Task *task1;
...
};
4174robot:4174robot()
{
task1 = new Task("testtask", (VOIDFUNCPTR) TestTaskFunction();
}
...
4174robot:Teleopinit
{
task1->start;
}
...
4174robot:Disabledinit
{
task1->stop;
}
...
4174robot:TestTaskFunction()
{
std::cout<<"task has been started"<<endl;
}
It complies fine (sometimes), but as I watch it on the WTX console, it just says something along the lines of "task failed." whey I start teleop.

Last edited by agartner01 : 07-02-2012 at 20:13.
Reply With Quote
 


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 14:32.

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