ROBOTC.net forums
http://robotc.net/forums/

MultiThreading in RobotC
http://robotc.net/forums/viewtopic.php?f=1&t=4706
Page 1 of 1

Author:  MillburnHighSchool [ Thu Jul 26, 2012 9:35 am ]
Post subject:  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.

Author:  NeXT-Generation [ Thu Jul 26, 2012 10:17 am ]
Post subject:  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
   }
}

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/