Programming With Robolab

Inventor Level 2

This level has the same functions as level 1 but some new items as well.

One difference is the provision of motors and lamps with no fixed port assignment.

The old motors and lamps on A, B and C are still available but there are also icons for unassigned motors and lamps and separate palettes for timers and sensors, jumps and modifiers.

The timer palette includes the same items as level one and also icons for the light sensor.

The Jump palette includes the icons for the Jump and Land actions. (Click on the arrow above the icons to return to the full palette.)

The Jump and Land icons can be placed in the opposite order so that code is skipped over.

The basic program provided can be modified by deleting the icons and adding new ones. Clicking on the timer, jump and modifier icons opens separate palettes within the same area - click the arrow to return to the main list.

This program uses an open motor icon with the modifiers to set it to A and power level 3:

The modifiers are used by clicking on the icon in the main icon window.

In this extended version the motors are reversed and power level 2 applied for 2 seconds.

The code here has been extended again so that the buggy turns on one motor for 2 seconds so it is facing in a different direction.

In the next example the Land and Jump icons have been added to create a loop so the buggy will reverse, turn and go forwards for ever. This code gives us the starting point for routines such as finding a path through some obstacles or locating objects within a designated area such as a circle.

The timer palette includes the light sensor, which can operate in one of two ways, either in response to brighter light or to darker light. The light received can be reflected light from a surface so this sensor can be used for robots designed to follow a line.

Exercise: Build a buggy that includes a light sensor and program it so that it moves around but stays on a sheet of paper.

The jump palette includes two icons used to represent a landing point and a jumping point.

The modifiers palette is used to specify the port for outputs and inputs and the power level for outputs. It is also used to add numeric constants to the open timer icon (no value specified) and to set the numeric value, in the range 0-100, for the light sensor. The value specified for the light sensor will be the threshold where an event is triggered as the light gets brighter or darker, according to the setting chosen. You may have to experiment with different values to find the best threshold value.

Back to Inventor Home Page