Go to Post Brandon, can you make some sort of mind-reading device that i can just think "portal" and i'll go back? - Tom Schindler [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
  #13   Spotlight this post!  
Unread 02-05-2009, 02:41 PM
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Threading

here is a brief overview:
Code:
#include...
Task tsk("myTask",MyTask);//creates task "tsk" identified by the name "myTask" on the cRIO, calling function MyTask
//put variables to be accesed by the task and norm. code here
RobotDrive myRobot(1,2);
class ...
...
void Auto()
{
    while (!tsk.IsReady())
    { }
    tsk.Start(1);//start MyFunction on another thread w/ args (1);
    while (IsAuto())
    {
    }
    tsk.Stop();
}
...
...
};//end of class
void MyFunction (int arg1)
{
//code using arg1
}
You can have up to 10 int args, and the function must be global
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Threading on the CRIO dpeterson3 Programming 4 01-04-2009 05:56 PM
Threading tool not working.... strange? q_prof Inventor 3 02-20-2006 12:14 AM
Muti-threading Ryan M. Programming 19 04-26-2004 09:10 AM


All times are GMT -5. The time now is 09:29 AM.

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