Télécharger Imprimer la page

fischertechnik COMPUTING ROBO MOBILE SET 8 Mode D'emploi page 52

Publicité

Les langues disponibles
  • FR

Les langues disponibles

  • FRANÇAIS, page 59
R
O B O
GB+USA
5 5
5 5
M
S
O B I L E
E T
Pretty intense, right? But don't worry there is a finished program for this model using all the advantages
ROBO Pro has to offer. It is called Edges.rpp.
The most important elements are located in the main program making it easy for you to understand the
sequence as a whole. The complex query of the sensors and the control of the motors are hidden in
subprograms. First the main program:
This programming technique is especially useful when you would like to use a subprogram for many
different models and don't know yet which inputs and outputs to you'll use on the Interface in each case.
If your curiosity has been piqued simply take a look at the subprograms and try to understand them. The
programming principle is similar to the "Lightseeker with Obstacle Detection" Model.
A s s i g n m e n t 2 ( L e v e l 3 ) :
Load the program into the Interface and let the model drive around a table.
● Does the model always react in the right way?
● Should it behave differently with certain sensor combinations?
● Tweak the program as required.
0 0
0 0
A
B
C T I V I T Y
O O K L E T
The sequence starts with the query of the 4
pushbutton sensors. All the way to the left you can
see which pushbutton sensor is being queried. They
are connected to the subprogram via data inputs. The
"Query" subprogram determines which pushbutton is
pressed and assigns the value detailed in the table
above. This value is assigned to a variable with the
same name that you'll be able to recognize in the main
program. The value of the variable is then sent to the
"Reaction" subprogram that controls both motors
depending on this value. The pushbutton sensors are
read again in the "Reaction" subprogram since the
edge sensors are still queried while the model is
avoiding the precipice.
If need be, you are now able to change the assignment
of the pushbutton sensors as well as the motor
outputs on the Interface, without having to dig through
the subprograms to see where an input element or a
motor symbol might be hiding. Each input and each
output appears only once.

Publicité

loading