

If a student wants to speak then they have to raise their hand and wait for the teacher to give them permission. RobotC’s faux-multitasking is handled by the “task scheduler” he offers a wonderful analogy of how this works.Ĭonsider a group of students sitting around a table having a discussion with their teacher. I include here text from the aweseome jpearman about how RobotC’s tasks work, because I couldn’t possibly say it better myself. Technically, RobotC can’t either, but it has the ability to make it seem like it’s multitasking using things called … wait for it … tasks. In eas圜, the best you can do with this limitation is some very well-crafted and efficient functions-called one after the other, each doing its thing and returning to the main loop-but you just cannot make it do 2 things at once. The VEX cortex (as it stands now, in the 2017-and-before universe) cannot multitask it has no capacity for doing so.
#Robotc how to program code#
Again, if you start above the first line of code that looks wrongly indented you should be able to track down your error.For those who are considering switching from eas圜 to RobotC (or if you’re like us, and you have switched but are still in the learning phase), I thought I’d write about an item in RobotC that does not exist in eas圜: tasks. You can see in the above code listing that task main() and its body are indented (pushed to the right). Unreferenced function / Undefined Procedureįrom the following code: void movForward ( float inches )

In a perfect world you should strive to have no messages at all in the Compiler Errors window pane, your code will generally be cleaner. Error something is broken and you need to fix it.The compiler is pretty sure you wanted to use it, but you’re not. You write a function moveForward(float inches) but it’s not being used. Warning the compiler is pretty sure this thing will cause a problem, just maybe not right now.Maybe you defined a variable to use somewhere else, but deleted that other code, so that variable is hanging around for no reason. These messages are really just to help you keep your code clean, as far as the compiler can tell they don’t have the potential to cause any problems. Info nice to know information that the compiler discovered.Let’s quickly chat about the various Message Types:
