frontkillo.blogg.se

Robotc programming tutorial
Robotc programming tutorial









robotc programming tutorial
  1. ROBOTC PROGRAMMING TUTORIAL HOW TO
  2. ROBOTC PROGRAMMING TUTORIAL CODE
  3. ROBOTC PROGRAMMING TUTORIAL WINDOWS

The execution stops automatically after the whole program has been executed.

ROBOTC PROGRAMMING TUTORIAL CODE

On pressing the Start button of the Program Debug window, the program execution starts and the following output of the example code is observed in the Controller Debug Stream. This will open up a blank Controller Debug Stream window. Now Go to “Robot –> Debugger Windows…” and click on “Debug Stream”. Running the Debug Stream Example ProgramĪfter downloading the program, the Program Debug window will pop up with options: Start, Suspend, Step Into, Step Over, Step Out, Clear All and Refresh. It is therefore a good practice to not let your messages exceed 19 characters in length, and if they do, use multiple writeDebugStream functions to print them. If a message or String variable exceeds 19 characters in length then a warning is displayed on compilation of the program- “String “…” exceeds 19 chars” and on running the program only the first 19 characters will be displayed. Note:- A message must be at most 19 characters long in ROBOTC.

ROBOTC PROGRAMMING TUTORIAL HOW TO

An example code showing how to write variables and messages to Debug Stream is shown here. The writeDebugStream function writes a string, passed as an argument to the function, to the debug stream while the writeDebugStreamLine function writes the string to the debug stream and then goes to a new line. Now use the predefined ROBOTC functions- writeDebugStream() and writeDebugStreamLine() in your program to print out a message or the current value of a variable, in the debug stream window.

robotc programming tutorial

These functionalities will be grayed-out initially, and are available once you run a program. You will now be able to see the Debug Stream functionality under Debugger Windows.

ROBOTC PROGRAMMING TUTORIAL WINDOWS

You will now find that the number of options under the Robot menu and the functionalities available in Debugger Windows have increased. To change the Basic user level in your ROBOTC– Click on the Window menu and under the Menu Level option, select the Super User functionality. This page shows how to use the Debug Stream in ROBOTC. The Debug Stream is the most useful option out of the three and is not available to the Basic user, but is available to the Expert and Super users.

  • Use the in-built Debug Stream functionality that helps by printing messages when you enter or exit loops and functions, or by printing the current value of a variable that you may have defined in the program.
  • If you are using an LCD display (like in the MINDSTORMS NXT) then you can print out statements to the display from your code and by examining them find out the part of code that is being currently executed.
  • Add tones and sounds to your program code, and from the sound determine which part of the code is being executed.
  • The 3 most common ways to do this in ROBOTC are:

    robotc programming tutorial

    So you have ROBOTC installed on your computer and are ready to program your LEGO MINDSTORMS NXT, but you need a debugging technique to find possible run time errors in your program?











    Robotc programming tutorial