Versions Compared

Key

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

...

There are several wrapper code snippets that can be used as annotations on input and output variables in the model file. These snippets are inserted in the main file template as part of the project build. The available snippets are listed below.

For sensors, the port has to be on of S1, S2, S3, S4.

For motors / actuators the port has to be one of A, B, C.

...

Resets a clock, such that the full time interval of the clock has to elapse, before the clock will be set to true again.

If autoFalse is true, the reset variable will be set to false automatically.

...

Delays the execution until the tick loop takes at least as long as the given target duration.

The input variable is set to the actual tick loop duration.

...

Should be used on the very first input variable in the model, such that waiting is the last action in the tick loop.

In case the actual tick loop duration is longer than the target duration, the modeler can provide some error handling.

...

Sets the input variable to the current system time (milliseconds). The model can add to this variable to get a new value. This is the next system time the tick function will be called.

In other words, the next tick function call is delayed until the wake up time has been reached.

For instance the statement nextTickWakeUp += 500 could be used to call the tick function again in 500 milliseconds, if nextTickWakeUp is an input with the corresponding annotation.

...

Should be used on the very last input variable in the model, such that waiting and settings the system time is the last action done, before the tick function call.

...

Reads  the value of a light sensor.

If percentValue is true, the a percent value is returned, based on the light sensor calibration.

...

output

...

output

...

Lets a motor rotate the variable value in degrees. This is only done if the value is unequal zero. If the value is negative, the motor rotates backwards. The variable is set to zero afterwards, such that setting the variable once to a value X, will let the motor rotate X degrees.

...

Plays a sequence of tones in either ascending or descending tone frequency if the variable is true.

The variable is set to false automatically.

...

direction has to be one of Up, Down

default volume is 10

...

ouput bool @macro "PlayTone", "440", "100", "10" A4

...

Not available on NXT

mode hat to be one of Angle, Rate

...

Resets a gyroscope if the variable is true.

If autoReset is true, the variable is set to false automatically.

...

here.


...

Using the Remote Console (RConsole)

...