Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The following shows how to create simple a project, that will turn on a light if a button is pressed.

Create a new project:

  1. Choose File > New > Project > SCCharts Project
  2. In the project creation wizard that opens, select Mindstorms NXJ as environment and hit finish
  3. The project wizard from the leJOS plugin opens. Set the project name to Flashlight and click finish.
  4. The project is created and the model file is opened in an editor (This might take a few seconds).

Edit the model:

Change the contents of the model file to the following code and save it.

...

The annotations on the input and output variable are used to define which wrapper code is used to set / read them. @Wrapper TouchSensor, S4 will set the input variable to true iff the touch sensor on the port S4 is pressed. @Wrapper Floodlight, S1 on the output variable will turn on the red led of the light sensor that is attatched to port S1 iff the variable is true.

Launch the project:

With the mouse over the SCT file in the project explorer, perform Right Click > Run As > KiCo Compilation.

...