TerkIDE Example Tutorial
Begin by running the TerkIDE by selecting it in the Start menu. The TerkIDE will initialize and eventually you will see the main window.
Create a Connection
You first need to connect to your VEXPro ARM9 by clicking on the New Remote Connection button on the left side of the main window in the Terk Navigator pane (see below).

It will bring up a new connection dialog. Enter the IP address of your VEXPro, the address you retrieved after setting up networking on the VEXPro and click OK (see below).

After setting up the connection, test the connection by clicking on Launch Terminal (below the New Remote Connection button). You will get a password window. Type in "qwerk" for the password and click on the Save password checkbox and click OK (see below).

When first communicating with your VEXPro, the TerkIDE may ask you to verify the authenticity of the connection (see below). Dismiss by clicking Yes.

If all is successful, you will get a terminal window and command prompt at the bottom of the main window (see below).

If you are familiar with Linux, you can type commands into the terminal window such as "ls /bin" or "ps". You are now talking to your VEXPro!
Creating an Example Project
We'll begin by creating a simple example that moves a motor back and forth. It's nothing exciting, but it will give you an idea of how to use the TerkIDE debugger as well as create your own VEXPro programs.
Click on the Create Example Project button on the left side of the main window in the Terk Navigator pane. It will then ask you to select an example project folder by bringing up a dialog (see below).

When the dialog appears, the examples directory will be selected (as shown) but you may need to scroll down to see it. Click on the examples directory to open it. You will see the available examples. Choose "motortest" by clicking on it and click on OK (see below).

The IDE will crunch for some moments and you will eventually see the motortest directory appear in the upper left corner when it's ready. You can click on the directory and browse the source code, which doesn't amount to much, just motortest.cxx.

Next, hook up a 2-wire motor to motor port 13, if you have one. If not, don't worry, the program will still run and you can still play with the TerkIDE debugger.
We're now ready to run and debug our example program. Click on Debug Program on the left side of the main window in the Terk Navigator pane. You will get the following dialog:

By default, the correct connection and project will be selected (because we're assuming that we only have 1 connection and 1 project -- for now at least!) Click on OK.
The TerkIDE will now ask you if you want to switch views to the Debug perspective. Go ahead an tell it that you want to by checking the Remember my decision check box and click on Yes.

The IDE will then upload the program into the VEXPro and execute it in the debugger. See the window below, which shows the Debug Perspective.

You are now debugging the program. You can step through it by pressing the Step Over button. Or you can run the program by pressing the resume button. Refer to the picture below.

- Run/resume will run or resume the program as normal without debugger interaction.
- Stop/kill will kill the program being debugged.
- Step into will step into the function or method at the current line of code being debugged and debug the function or method.
- Step over will step over (skip) the function or method at the current line of code being debugged and move to the next line.
Note, the other buttons that aren't labeled are for advanced debugging and should be avoided!
Next Steps
You can play with the program, such as modify the motor speed, etc. and debug or run again. An important detail to be aware of is that there are 2 "perspectives" in the TerkIDE: Debug and Terk:
- The Terk perspective is the default perspective and is used to develop code. It can be selected by clicking on the Terk icon in the upper right corner of the main window (refer to picture below).
- The Debug perspective is used to debug code. It can be selected by clicking on the Debug icon in the upper right corner of the main window (refer to picture below).

When debugging a program, the IDE will automatically switch to the Debug perspective. If after debugging you want to tweak/modify the code, you will need to switch back to the Terk perspective.
Run Instead of Debug
Instead of debugging, you also have the option to simply run the program without a debugger. To do this, click on Run Program on the left side of the main window in the Terk Navigator pane. You will notice that the console output of your program is displayed for you. So for example, if you call printf() in your program, you will see the text in the console window.
To stop the program being run, click on the Terminate button (refer to picture above).
Creating a New Project
The VEXPro examples are a great place to start when writing a program. It's often easier to start with an example and modify it instead of starting from scratch with a new project.
However, sometimes you prefer to start from scratch, in which case click on Create New Project in the Terk Navigator. You will then be asked to name your project. Important: do not put any spaces in the your project name. There is an issue in Eclipse that prevents this. You will also be given some options for the project type: Empty Project or Hello World C++ Project. Choose whichever you prefer, but if you're confused, the hello world project can be simpler. Click Finish to complete. You will then see your project appear in the Project Explorer pane on the left side of the main window. If you chose a hello world project, you can click on Run Program and you're off and running.
previous | next
Code