Sei sulla pagina 1di 5

Programmieren mit NEPO

Programming with NEPO


Content
> Home
Index:
Programming with NEPO
Your first program - Hello Roberta!
Do you know how ...
EV3 Robot configuration
Standard configuration
Your own robot configuration
Sensors
Motors
Starting a program on the robot
NEPO
Block Categories
Action
Sensors
Control
Logic
Math
Variables
Lists
Functions
Messages

Programming with NEPO follows a simple principle. The blocks are interconnected and will be executed by the robot according to their
order. This principle is called sequential operation. Only blocks that are connected with each other are executed while running the program.
The blocks that are connected together and to the start block are also called sequence or task.
To connect blocks with each other, they have sequence connections and/or connectors. Depending on the mode of a block, the number of
the connectors may vary.

Programming with NEPO is really easy. Every program begins with the program-start block.
This block is always added by default in the Open Roberta Lab workspace. The first block you want
to use is connected with the sequence connector of theprogram-start block. The sequence
connector is a triangle at the bottom of the block, and this triangle will become yellow as soon as a
suitable block is in close proximity of the block.

Your first program - Hello Roberta!


Now we are going to write our first program. This program should display Hello Roberta on the
robot's display and the robot should drive forward.
First we are going to take the show text-block from the Action category. We will change
the given text in the block with simply clicking on the given Hallo text and writing our
own text.
Afterwards we need to add one more block for the robot to move forward. This block also
can be found in the Action category.
We are done with the program! In the next section we show how the correct configuration
of the robot should look like. This program only uses the motors from the standard

configuration, therefore you can jump to the section Starting a program on the robot.

Do you know how ...


Within the section Do you know how ... we show you different sample programs. There is a brief
description and a model solution for each program. Each sample program has the following
categories:
Description:
Table:
robot
motors
sensors
block category
difficulty
note
Result:
So far you will find following programs online:
Driving a square
Cornering
Controlled program termination
LED status display
Own blocks, macros, methods
Line follower

EV3 Robot configuration


We have simply modeled the EV3-Brick in the EV3 Robot Configuration menu. This is important because here you have to declare which
motors and sensors are connected to the robot. It is also important to define the types of motors and sensors (e.g. large motor or color
sensor), and the connection ports have to be correctly assigned (1 to 4 for the sensors and A to D for the motors) on your robot. Only if the
robot configuration setup is exactly like your robot construction your program can be executed correctly by the robot. If the robot configuration
does not match the program created, then the robot either will do nothing or it will throw an error.

Wheel diameter and track width


Additionally to the motors and sensors configuration the wheel diameter and track width (the distance between the left and the right wheel)
have to be assigned. This is important, because if you are using blocks from the Action category the distance parameter for the calculation of
how much the robot has moved is based on this configuration.

Standard configuration
To simplify the robot configuration, we have already created one default configuration. This
configuration contains one touch sensor (on sensor port 1) and one ultrasonic sensor (on sensor
port 4), and two large motors (on motor ports B and C). The wheel diameter is 5,6 cm and the track
width is 13,5 cm.
This configuration corresponds to the robot of the LEGO Education building instructions.

Your own robot configuration


You can save the robot configuration; so you do not always have to reconfigure your settings. For

this, you need to log in to the Roberta Open Lab. Then you go to the Robot configuration
EV3basis menu to configure the settings as they match to your real robot. Afterwards click the
menu edit and save - or save as. Using save as you can give your robot configuration a
new name. If you click only on save, the existing setting will be overwritten with the name Robot
configuration EV3basis.

Sensors
Here you declare the sensors connected to the sonsorports. For this you only need to drag one of
the available sensors to the corresponding sensor port.

Motors
The settings are done like those of sensors. Drag the corresponding motor to the motor port,
according your robot model. Additionally, there is the possibility of other power consumers to be
connected to an engine port.

Starting a program on the robot


To start a program simply click on the start button on the lower-right corner of the screen. Your
code will be in machine code translated and sent to the robot.
You will get a hint on the top line of the Open Roberta Lab that the program will start
shortly.
On the robot screen the NEPO-Logo will appear.
While the program is running on the robot, the robot icon in the right part of the Open
Roberta Lab menu line will blink red and green.
The robot should display Hello Roberta! on the screen and drive forwards.

The program can be also started from: Edit run

NEPO
NEPO, this is how we call our graphical programming language. It is easy and fun to learn programming. NEPO can also be used to
program and interact with other robot systems. We hope that there will be an opportunity for one of our upcoming updates of the Open
Roberta Labs that you can for example program a NXT robot with NEPO.

Maybe NEPO seems familiar to you. When designing NEPO we were inspired by existing concepts like scratch and blockly.
The graphical NEPO blocks have different components and thus different attributes. A block always represents a certain functionality. Its
function can easily be recognized through the associated block category, for example sensors . Other features of the graphical blocks are:

Selection Menu
In the selection menu you can choose between various functionalities such as in block drive bet
ween forward and reverse.

Sequence conncetion
Using the sequence connection, the blocks are interconnected. The program consists of all
interconnected blocks. The blocks will be executed according to their order - from top to bottom. A
NEPO block can have more then one sequence connection.

Input - Parameter Input


Depending on the block different values can be passed to a block. The type of the value can be
identified by the colored compounds (called connectors ) of a block. In the chapter block
catagory you can see the different values a block can have. Only if the colors of the input and the
output connector match, these blocks can be connected.

Output - Return parameters


A block may optionally also pass a value (only one!) to another block. These blocks have colored
output connectors. Only if the colors of the input and the output connector are of the same type
these blocks can be connected.

In total there six input and output types within NEPO. These types can have the following values:
1.
2.
3.
4.
5.
6.

Logical value (light blue)


Number (dark blue)
String/Text (green)
Color (yellow)
List (purple)
Connection (pink)

The type List can even include the other four values.

Block Categories
A block-category summerizes blocks which have the same functionality. For example, the
block-category "sensors" contains all blocks which can be used to program the standard LEGO
MINDSTORMS EV3 sensors.

The Open Roberta Lab offers two choices that will serve for clarity when selecting existing blocks:

Step 1: Login

Beginner
Expert
Switching between block-categories is possible only after login (see right).
The selection "Beginners" is the default selection. This category includes the main program blocks
which are most important for programming a robot.
Choosing "Advanced" includes the one additional block-categories "Functions" and "List" and
additional NEPO blocks in other block categories.
NEPO offers eleven block categories:
Action
Sensors
Check
Logic
Math
Text
Lists "Advanced"
Colors
Variables
Functions "Advanced"
Message "Advanced"
The description of the blocks and the available configuration options refer to the standard model
EV3. It is used to describe the following scheme:
Setting options:
Operation
Enumeration of blocks belonging to the category
Description of the individual blocks
Settings of the blocks

Step 2: Select category

Potrebbero piacerti anche