View unanswered posts | View active topics It is currently Thu Oct 02, 2014 8:28 am






Reply to topic  [ 2 posts ] 
MultiThreading in RobotC 
Author Message
Rookie

Joined: Fri Jul 20, 2012 10:29 am
Posts: 4
Post MultiThreading in RobotC
What is the syntax for a multithread in RobotC? (.c or .cpp file)

The situation is basically that a motor is constantly running no matter what, and a sensor is checking if its triggered.
If its triggered an event occurs while the aforementioned motor is still running, regardless if the sensor was triggered or not.


Thu Jul 26, 2012 9:35 am
Profile
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post Re: MultiThreading in RobotC
Most things can be accomplished without multithreading. Your example is very easy to accomplish.

Code:
while(true)
{
   motor[motorA] = 100;
   if(SensorValue(touch) == 1)
   {
      //do stuff
   }
}

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Thu Jul 26, 2012 10:17 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.