Herunterladen Inhalt Inhalt Diese Seite drucken

Turning Left; Left, Right, Forward, Backward - fischertechnik BIONIC ROBOTS Begleitheft

Inhaltsverzeichnis

Werbung

Verfügbare Sprachen
  • DE

Verfügbare Sprachen

  • DEUTSCH, seite 4
GB+USA
The variable VAR2 provides the impulse for starting motor M2. The motor
M1 is started. As soon as pushbutton E1 is activated, M1 stops. As soon
as E2 is activated, M2 stops. The first process waits until M2 has stopped
(the status of motor M2 is queried via E32; also refer to the Querying the
Motor Status in the LLWin manual).
By the way, if you do not feel like creating this process yourself, you can
find it as example project MIKE_STRAIGHT.MDL on the enclosed CD.
Start the project. If you have programmed everything correctly, the model
comes to life and walks straight ahead. Congratulations! The first step
has been taken.

3.2.3 Turning Left

Of course, we are not satisfied that Mike can only walk straight ahead.
As the next step, we want him to turn around.
Task 2:
Program Mike, so that he turns to the left (counter-clockwise).
Tips:
The model turns to the left if M1 turns to the left and M2 to the
right. Of course, you can also drive the model unsynchronized.
It also turns then, but then there are spots where the model can
fall over forward. This can be avoided with the following process:
14
Using the pushbuttons E1-E4, the left and right sides of the model first
move together one step, then the left side takes a step, then the right,
etc. In this way, the model never falls over forward. Try it! Then it will
be easier for you to understand this sequence.
You can also find this process as project MIKE_LEFT.MDL on the CD.
Now the model can walk straight ahead and turn left. Only walking
backward and turning to the right are missing. In principle, walking
backward functions the same as walking forward, only with reversed
motor rotation. Turning to the right (clockwise) functions opposite to
turning left in principle.

3.2.4 Left, Right, Forward, Backward

Task 3:
Now program each of the functions STRAIGHT, BACK, LEFT and
RIGHT as subprograms, so that you can use them flexibly in
various projects later.
Tips:
The procedure for copying an existing process into a subprogram
is described in the LLWin manual.
Use a different variable (VAR2-VAR5) in each subprogram to start
the process for motor M2.
To ensure that the model
does not fall over during
the turn to the right, it
must first move one step
forward with the right side
and the one step forward
with the left side. Then
both sides can take a step
together, etc..
The subprogram for this is
structured as follows:

Quicklinks ausblenden:

Werbung

Inhaltsverzeichnis
loading

Inhaltsverzeichnis