Page tree
Skip to end of metadata
Go to start of metadata
Content

> Home

Inhalt:



»start« 

Each program starts with the red »start« block.

This block is always available in the Open Roberta Lab and cannot be deleted. The little triangle below the start block is called  »sequence connector«. The first block you want to use will be connected by using the »sequence connector« at the start block.  The sequence connector color changes to yellow when a suitable block comes into its range.

Settings:

  • create a new global variable
  • delete the global variable

If global variables have been created:

  • Text, name of the variable
  • Type of the variable, »Number«, »Boolean«, »String«, »Colour«, »Image«, »List Number«, »List Boolean«, »List String«, »List Image«
  • Value, that corresponds to the variable type. This is the initial value of the variable.



After creating a new global variable:




Action

The »Action« category contains the blocks where an action is performed on the robot. For example, speaker or display of the Calliope can be programmed.

The »Action« Category includes the following program blocks:

  • Blocks to control the display
  • Blocks to control the status light
  • Blocks to control the speaker

In expert mode, the category »Action« is subdivided into the following subcategories:

  • Display
  • Lights
  • Move
  • Sounds
  • Pin

The expert category contains all blocks of the beginner category.






»show text/character«

With the »show text/character« block you can display text and numbers on the display of your robot. 

Settings and input values:

  • Text (floats over the display) or character (are shown after each other).
  • Text or number you want to show.




»show image/animation«

With the »show image/animation« block you can show selfmade or predefined images on the display.

Settings and input values:

  • Image or Animation (images are shown sequentially).
  • single image or list of images.



 

 »clear display«

With the »clear display« block you can delete what is shown on the display.





»set brightness« [Expert-Block]

The brightness of all LEDs on the Calliope display will be set to a uniform value. 0 switches off all LEDs, 9 is the maximum value.

Input value:

  • Number, value between 0 and 9.




»get brightness« [Expert-Block]

The brightness of all LEDs on the Calliope display will be read. 0 indicates that all LEDs are switched off, 9 is the maximum value.

Return value:

  • Number, value between 0 and 9.




»set LED x y brightness« [Expert-Block]

The brightness of a single LED on the screen of your Calliope mini is set to a value. The position of the LED is determined by x-axis and y-axis. x is the horizontal axis and y is the vertical axis. 0 turns off the LEDs, 9 is the maximum brightness value.

Input values:

  • Number, value between 0 and 4 for the x position of the LED. 0 stands for the first LED in the row and 4 for the fifth and last LED in the row.
  • Number, value between 0 and 4 for the y position of the LED. 0 stands for the first LED in the column and 4 for the fifth and last LED in the column.
  • Number, value between 0 and 9.




»get LED brightness x y« [Expert-Block]

The brightness of a single LED on the Calliope display will be read. The position of the LED is defined by x and y. A brightness value of 0 indicates that the LED is switches , 9 is the maximum value.

Input values:

  • Number, value between 0 and 4 for the x position of the LED. 0 stands for the first LED in the row and 4 for the fifth and last LED in the row.
  • Number, value between 0 and 4 for the y position of the LED. 0 stands for the first LED in the column and 4 for the fifth and last LED in the column.




» Show on Serial Monitor ... « [Expert-block]

With the block "Show on Serial Monitor..." you can display the output in a Serial Monitor of your choice (e.g. Arduino Serial Monitor / (Chrome) Browser Serial Monitor).

Input value:

  • Specify what should be displayed on your Serial Monitor. Possible variants are: Number, boolean, string or color.




» Show 4-Digit Display Number ... position ... colon ... « [Expert-block]

With this block you can display a number from 0 to 9999 on the Grove 4-digit display of Seeed. The display must be connected to the right Grove connector (A1). The position from 0 to 3 indicates the starting position of the number.

Options:

  • Number, Value between 0 and 9999. This number will be shown on the display.
  • Number, Value between 0 and 3. This is the starting position of the number.
  • Boolean, true or false. Specifies whether to display a colon in the center.



» Clear display 4-Digit Display « [Expert-block]

This block deletes the output on Seeed's Grove display when it is connected to the right Grove connector (A1).




»turn LED on colour ...«

With the  »turn LED on colour ...« you can turn on the status LED in a particular colour.

Input value:

  • Colour in which the LED should light up.





»turn LED off«

With the »turn LED off« block you can turn off the status LED.





»motor port ... on speed« [Expert-Block

The block »motor port ... on speed« can be used to turn on a motor and to control its speed.

If two motors are connected both will run with half power. If one of two connected motors shall not run the speed value explicitly has to be set to 0. It is recommended to use pairs of motor blocks - one block for each motor - when two motors are in use. 

Settings and input value:

  • Motor; pick the motor you want to control.
  • Number, a value between 0 and 100.




»Stop motor port ... « [Expert-Block]

Using the block »stop motor port ...« switches off one selected motor. You can decide the motor to run out slowly (float) or to break immediately.

Settings:

  • motor port, choose the port where the motor is connected to.
  • float or brake; make your choice.




»play frequency« [Expert-Block]

With the »play frequency« block you can program the frequency (pitch level) and the time (how long the sound should be played) of the sound that is played. The sound is played by the built-in speaker of your Calliope for a defined of time. The frequency setting corresponds directly to the frequency in Hertz, for example, setting the frequency to 400 corresponds to 400 Hertz. Example: 261 = C.


Note that the human ear can perceive frequencies from about 30Hz to about 15,000Hz (15kHz). This can vary depending on the person and their age.

Settings:

  • Number, desired frequency in Hz (Hertz) .
  • Number, desired duration in milliseconds (ms).





»play...«

With the »play ...« block you can play notes on your Calliope.

Settings:

  • Note length; select the length of the note that is going to be played.
  • Note pitch; select the note that is going to be played.





»write analog/digital value to pin ...« [Expert-Block]

With the »write analog/digital value to pin....« block you can send signals to an outputpin .

Settings and input value:

  • analog or digital.
  • In and output pin 0 to 3.
  • Number: value to write






Sensors

The category »Sensors« contains blocks for all sensors of the Calliope system:

  • button
  • gesture
  • compass sensor
  • timer
  • temperature sensor
  • ambient light
  • in and output pins

A special feature of the sensor blocks compared to the action blocks is that many sensor-blocks return a »value«. The value type returned by a sensor block corresponds to the color of the connector. The connector is the "nose" which enables NEPO blocks to be inserted into other blocks. An exact description can found in section NEPO.




 

»button ... pressed?«

With the block »button ... pressed?« you can "tell" another block whether a button is pressed or not. This block returns the logical values true = pressed or false = not pressed. This block can only be used in conjunction with another block which requires a logical value as an input parameter, for example together with the »if do« block.

Settings:

  • Button, select the button you want to check.
Return value:
  • Boolean value: »true«, if the button is pressed, otherwise »false«.

 



 

»gesture ... aktive?«

With the block  »gesture ... aktive?« you can  "tell" another block whether the Calliope is in a specific gesture or not .

If the Calliope is in the checked gesture the return value will be true. If not it will be false.

Settings:

  • gesture to be checked.

 





 

»get value compass sensor«

Using the block »get value compass sensor« you can check the orientation of your Calliiope.

First you will have to calibrate the Calliope by drawing a circle with it.

Return value:

  • Number; deviation in degree.

 



 

»get value microphone«

Get the value of noise close to the Calliope. The microphone is not very sensitive, so the sound you check should not be far away.

Return value:

  • Number, volume level from 0 (quiet) to 100 (loud). For elder versions of the Calliope it is possible that only values between 0 and 10 are given.

 



»get value timer in ms«

With the block »get value timer in ms« you can "tell" another block the current time in milliseconds of the internal timer.

Setting:

  • Timer number, select the timer you want to read.
Return value:
  • Number, milliseconds since program start or since the last reset of the selected timer.




»reset timer«

With the block »reset timer« the internal timer can be reseted to the value 0.

Setting:

  • Timer number, select the timer you want to reset.

 



 

»get value temperature sensor«

with the »get value temperature sensor« you can read out the currently measured temperature.

Return value:

  • Number; Temperature in degrees.

 



 

»get value ambient light«

With the block »get value ambient light« you can measure the brightness of the ambient light.

Return value:

  • Number; brightness between 0 and 255.

 



 

»is pin ... touched?«

You can check whether a pin of the Calliiope is touched or not by using the block »is pin ... touched?« . This block returns logical values (true if the pin is touched and false if not)

Settings:

  • Pin, select the pin you want to check.
Return value:
  • Logical value: »true«, if the pin is touched, »false« else.

 



 

»get analog/digital value pin ...« [Expert-Block

With the »get analog/digital value pin ...« block you can read out a analog or digital input value. You can connect other devices or additional modules to a  pin.

Settings:

  • Analog/Digital; which kind of signal do you want to read?
  • Pin, select the pin you want to read out.
Return value:
  • Number; current input signal.

 



 

»get value acceleration mg ...« [Expert-Block]

The acceleration of the Calliope will be given, according to the three coordinate axes x, y and z.

Setting:

  • x/y/z-strength; for which direction do you want to read the acceleration value? z for instance is the falling direction where the earth gravitation acts. Strength is the sum of all directions.

 



 

»get value rotation ...« [Expert-Block]

Read the value of rotation in degrees, how the Calliope was pitched or rolled.

Settings:

  • »pitch« for measurement related to the transversal axis; »roll« for measurement related to the longitudinal axis.
Return value:
  • Number, grades within the range of -180 and 180.

 

                        pitch / roll

Control

The category "control" includes blocks with which the program sequence can be controlled. The category includes the following blocks:

  • if do
  • if do else
  • repeat indefinitely
  • repeat n times
  • wait
  • wait until
  • repeat while/until [Expert-Block]
  • for each item in list [Expert-Block]
  • count with from to [Expert-Block]
  • break out/continue with next iteration of loop [Expert-Block]


»if do«

With the block »if do« you can selectively trigger actions to be executed by your robot. The »if do« block therefore requires a logical value as an input parameter, the condition. Only if the condition of the »if« statement is true, the inserted block will be executed. In a nested »if do« block, if a further distinction was added, the first »if« condition is queried. If it is not fulfilled (condition = false), the second »else if« condition will be checked. Also this second condition requires a logical value as an input parameter.

The conditions may arbitrarily be expanded by clicking the "+" plus symbol. The "-" minus symbol reduces the block.

Settings and input values:

  • Insert an additional condition.
  • Delete the last condition.
  • Boolean value, »true« or »false«.
  • Blocks that will be executed


»if do else«

With the block »if do else« you can selectively trigger actions which are executed by your robot. The »if do then« block therefore requires a logical value as an input parameter. If the condition in »if« is true the  inserted block will be executed, otherwise (condition is not fulfilled = false) the block connected to the »else« statement will be executed. In a nested »if do else« block with further distinctions added, the first  »if« condition is queried. If it is not true, the second condition »else if«  is checked. Also the second condition requires a logical value as an input parameter. Only when both conditions are not true, the block which is inserted at the »else« statement will be executed.

The conditions may arbitrarily be expanded by clicking the "+" plus symbol. The "-" minus symbol reduces the block.

Settings:

  • Insert an additional if-do-else condition.
  • Delete the last if-do-else condition.
  • Boolean value, »true« or »false«.
  • Do blocks that will be executed if the according condition evaluates to »true«.
  • Else blocks that will be executed if the according condition evaluates to »false«.


»repeat indefinitely«

With the block »repeat indefinitely« you can endlessly run the blocks on your robot. All blocks which are within the »repeat indefinitely« block will be executed endlessly. The blocks are applied sequentially from top to bottom. Once the last block has been executed, the program repeats with the first block again. Therefore, this block is also called »loop«.

Input:

  • Blocks to be repeated indefinitely.


»repeat n times«

With the block »repeat« you can run other block as many times as you like. All blocks in the »repeat« block will be executed as often as defined in the entry field. The blocks are applied sequentially from top to bottom. Once the last block has been executed, the program repeats with the first block again. Therefore, this block is also called »loop«.


Only integer values can be entered.


Settings and input:

  • Number that indicates how often the contained blocks will be repeated.
  • Blocks to be repeated as often as defined.


»wait«

With the block »wait« you can "pause" your program at the point where you inserted the »wait« block. Your program will then remain for the specified duration at this point. After the specified time the next block will be executed. For example you can display text in the screen of your robot for exactly the time you specified in the »wait« block.

Settings and input values:

  • Number, waiting time in milliseconds.


»wait until«

With the block »wait until« you can "stop" your program at the point you insert the »wait until« block. Your program then waits until the condition is true. The »wait until« block you can extended by click on "+" symbol. Your program then waits until (at least) one of the condition of your »wait until« block is true.

Settings:

  • Add a new condition.
  • Delete the last condition.
  • Boolean value, »true« or »false«.


»break out/continue with next iteration of loop« [Expert-block]

With the block »break out/continue with next iteration of loop« a loop can be terminated ahead of schedule. As soon as the block is entered within a sequence of blocks, all further blocks up to the end of the loop will be ignored.

Settings:

  • Type of breaking behavior, »break out« or »continue with next iteration«.


»count with from to« [Expert-block]

With the block »count with from to« you can run other block as many times as you like. All blocks in the »count with from to« block will be executed as long as the counting is in progress. The blocks are applied sequentially from top to bottom. Once the last block has been executed, the program repeats with the first block again if the counting is in progress. The last parameter declares the step width for counting.

Settings:

  • Variable, name of free choice; numbers of the counter will be delivered one after the other to the variable. 
  • Number, initial value of the counter.
  • Number, final value of the counter. As the counter exceeds this value the loop ends.
  • Number, defining the increment. The variable value will increase by this amount after every loop cycle.
  • Blocks that will be executed in every loop cycle.


»for each item in list« [Expert-block]

With the block »for each item in list« all list items will successively be bound to a variable. The variable can be used within the loop. With each loop cycle the next item of the list will be bound until all list elements have been processed.

Settings and input value:

  • Type of list elements, »Number«, »String«, »Boolean«, »Colour«, »Connection«
  • Variable, name of free choice; list elements will be delivered one after the other to the variable.
  • List  that contains elements of the desired type. If the list elements are not of the correct type then the list will not fit to the input slot.
  • Blocks which will be executed as often as there are elements in the list.


»repeat while/until« [Expert-block]

With the block »repeat while/until« you can run other block as many times as you like. All blocks in the »repeat while/until« block will be executed as long as the condition in the entry field is true. The blocks are applied sequentially from top to bottom. Once the last block has been executed, the program repeats with the first block again if the condition is still true. Therefore, this block is also called »conditional loop«.


Settings and input values:

  • Option, »while« or »until«, defining the type of the conditional repetition.
  • Boolean value, »true« or »false«.
  • Blocks that will be repeated while/until the condition evaluates to »true«. 



Logic

With the »logic« blocks you can "create" conditions. With this condition you can interrelate states, values, and events with each other.

The following »logic« blocks are available at NEPO :

  • comparison
  • and/or
  • not [Expert-block]
  • true/false
  • null [Expert-block]
  • test [Expert-block]



»comparison«

With the block »comparison« you can compare different parameters of the same type (number, color, logical value, text). This block can only be used in conjunction with another block which requires a logical value as an input parameter.

Settings and input values:

  • Value for the left hand side.
  • Comparison, select one of =, ≠, <, ≤, >, ≥
  • Value for the right hand side.

Return value:

  • Boolean value, »true« or »false«.


»and/or«

With the block »and/or« you can interrelate logical values with each other. The »and/or« block with the setting "and" will be true only if both logical parameters are "'true"'. If the block has the setting »or« it is sufficient if one of the two parameters is "true", so that the »and/or« block will return true.

Settings:

  • Boolean value on the left hand side.
  • Boolean function, »and« or »or«.
  • Boolean value on the right hand side.
Return value:
  • Boolean value »true« or»false«.


»true/false«

With the block »true/false« you can return either the logical value »true« or »false« to another block.

Settings:

  • Boolean value, make your choice.
Return value:
  • Boolean value, »true« or »false«.


»not« [Expert-block]

Using the »not« lets you invert a logical value and pass this value to another block.

Input value:

  • Boolean value, to be inverted.
Return value:
  • Boolean value, »true« or »false«; result of inverting.


»test« [Expert-block]

Using the »test« block will perform a test and returns a value which depends on the test result.

Input values:

  • Boolean value for the test; if no input value is given "true" will be assumed.
  • Arbitrary value, evaluated by a block.
  • Arbitrary value, evaluated by a block.
Return value:
  • Value of arbitrary type.


»null« [Expert-block]

The block »null« is a place holder for an input value that is not yet specified. If for instance a new connection variable has been created and is not yet bound, the initial value of this connection will be set to »null«.

Return value::

  • Boolean value, »null«.




Math

Using »Math« blocks offers calculations and parameter settings.

The following »Math« blocks are available at NEPO:

  • parameter
  • calculating
  • mathematical function [Expert-Block]
  • trigonometric function [Expert-Block]
  • constant [Expert-Block]
  • number property [Expert-Block]
  • change by ...  [Expert-Block]
  • round [Expert-Block]
  • list evaluation  [Expert-Block]
  • remainder of [Expert-Block]
  • constrain [Expert-Block]
  • random integer [Expert-Block]
  • random fraction [Expert-Block]


»parameter«

With the block »parameter« you can send numbers to another block.

  Settings and input values:

  • Number

Return value:

  •  Number


»calculating«

With the block »calculating« you can sum up, subtract, multiply, and divide numbers. This block can only be used in conjunction with another block which requires a number as an input parameter.

Settings and input values:

  •  Number, first number on the left you want to calculate with.
  • Option, mathematical operator, choose one of +, −, ×, ÷, ^.
  • Number, second number on the right you want to calculate with.
Return value:
  • Number, result of the calculation.


Degree and Radiant Measurements

In standard blocks of Open Roberta, especially along with the actions »turn… by x degree« and in the sensor block »get angle gyrosensor …« the angles will be represented in degree (0° ... 360°). The unit is called degree and will be represented by the Symbol °. 90° represents a right angle, 180° a half circle or a turn around, and 360° represents a full circle.

The trigonometric functions in the expert mode, like sin, cos, tan, ... the input parameters will be expected to be given in radian measure. The unit is called RAD. A right angle is represented by π/2, the half circle or turn around is π, and the full cirle is 2π.

To convert degree (°) into radian measure (RAD) or vice versa  you may use the following calculations:

  • degree to radian measure: (x degree / 180) * π
  • radian measure to degree: (x RAD * 180) / π



»mathematical function« [Expert-block]

With the block »mathematical function« some elementary mathematical functions may be calculated. Available functions are »square root«, »absolute«, »invert« (multiply by -1), »ln« (natural logarithm), »log10« (decadic logarithm), »e^« (exponential function), »10^« (base 10 exponent)

Settings and input value:

  • Option, mathematical function, choose one.
  • Number to apply the function to.
Return value:
  •  Number, result of the function application.


»trigonometric functions« [Expert-block]

With the block »trigonometric function« sine, cosine, tangent and their respective revers functions can be calculated. Input values are expected in radian measure(see hint above).

Settings and input value:

  • Option, trigonometric function to choose from.
  • Number, in radian measure.

Return value:

  • Number, result of the trigonometric calculation.


»constant« [Expert-block]

With the »constant« block some mathematical constant values are available: »π« (3,1415...), »e« (2,718...), »φ« (1,618...), »sqrt(2)« (1,414...), »sqrt(½)« (0,7071...), »∞«

Settings:

  • Option, mathematical constants, choose one.
Return value:
  •  Number, value of the selected mathematical constant. Infinity will return »infinity«.


»number property« [Expert-block]

With the block »number property« you check whether a given number has a specific property: »even«, »odd«, »prime«, »whole«, »positive«, »negative«, »divisible by«.

Settings and input values:

  • Number, the property of this input value will be checked.
  • Option, number property, choose one.
  • Number, evaluated from a block. The second input value is only required for the property »divisible by«.
Return value:
  • Boolean value, »true« or »false«, depending on the selected property.


»change by ... « [Expert-block]

The block »change by ... « increments a numerical variable by a defined value.

Settings and input values:

  • Variable name, which value is to be changed. Choose the variable to be changed.
  • Number, given by a block.


»round« [Expert-block]

With the block »round« values may be rounded. Rounding will set the decimal places to 0. It depends on the value of the decimal places whether the block rounds up or down. You may also decide by settings to always round up or down.

Settings and input value:

  • Type of rounding, choose a round mode.
  • Number you want to round.
Return value:
  • Number, rounded whole number, according to the round mode.


»list evaluation« [Expert-block]

With the block »list evaluation« you may analyse a list.

Modes for list evaluation:

  • sum - addition of all list values
  • min - smallest value in the list
  • max - largest value in the list
  • average - average of all list values
  • median - median of all list values
  • standard deviation - standard deviation of all list values
  • random item - one list value randomly selected
Settings and input value:
  • Mode of list evaluation, choose one mode.
  • List of numbers
Return value:
  • Number, calculated according to the selected list evaluation mode.


»remainder of« [Expert-block]

The block »remainder of« calculates a divison and returns the remainder of the division.

Input values:

  • Number to be divided (dividend).
  • Number, divisor.
Return value:
  • Number, rest of the division.


»constrain« [Expert-block]

The block »constrain« ensures that given boundaries will not be exceeded.

Input values:

  • Number, that will be constrained.
  • Number, lower bound.
  • Number, upper bound.
Return value:
  • Number, constrained by the lower and the upper bound.


»random integer« [Expert-block]

With the block »random integer« you may generate random integer numbers within defined limits

Input values:

  • Number, lower bound
  • Number, upper bound
Return value:
  • Number, a whole random number from within the upper and lower bounds.


»random fraction« [Expert-block]

With the block »random fraction« a random value between 0.0 and 1.0 is calculated.

Return value:

  • Number, positive random value between 0.0 and 1.0.



Text

»Text« blocks perform simple operations on text strings.

Available »Text« blocks in NEPO are:

  • Text
  • create text [Expert-block]
  • append text [Expert-block]


»Text«

The simple »Text« block creates a little text.

Input value:

  • String, containing arbitrary characters.


Return value:

  • String, containing arbitrary characters.


»create Text« [Expert-block]

The »create text« block compiles a text from different input parameters. Using the + sign will insert further input slots. All input parameters will be connected one after the other. Essentially the »create text« block converts an arbitrary input value into a text string.

Input values:

  • Arbitrary values [numbers, text, logical values, colours)
Return value:
  • String, containing arbitrary characters, compiled sequentially from all input values.


»append Text« [Expert-block]

The »append text« block will append some string to a given string, for instance to extend a message with a signature.

Input values:

  • String, to which some other text will be appended.
  • String, that shall be appended.



Variables

The »Variables« blocks are used to create global variables of six different parameter types. The global variables store values which may be used at arbitrary positions in a program.

Each variable has to be created prior to its use. Create a variable by clicking the »+« sign in the »start« block. Each variable has to be assigned a name and a parameter type. Further clicks on the »+« sign will create additional variables.

The name of a variable has to be unique in a program.

Settings and input values:

  • Insert another variable.
  • Delete this variable.
  • Variable name, special characters and space sign are not allowed.
  • Variable type, »number«, »boolean«, »string«, »colour«, »connection«, »list number«, »list boolean«, »list string« oder »list connection«
  • Initial values, according to the variable type.

These »Variables« blocks are available in NEPO:

  • set variable
  • get variable


»set variable«

Using the block »set variable« will assign a value to a variable. Depending on the variable type the value may be assigned by an input connector.

Settings and input value:

  • Variable, which value is to be changed.
  • Value, new value for the variable, evaluated from a suitable block.


»get variable«

Using the block »get variable« returns the value of a variable to another block.The type of the output parameter is equal to the type that has been assigned to the variable in the »start« block.

Settings:

  • Variable, that will be read. The value will not be changed by reading.


Return value:

  • Value, stored in the variable.



Lists [Expert-blocks]

A list is a sequence of data (of identical parameter types) with elements in a fixed succession. Create a »list« type variable to make use of a »Lists« block. NEPO provides five different parameter types for lists: number, string, boolean, colour and connection.

NEPO provides the following »Lists« blocks:

  • create list
  • repeat element in list
  • length of
  • is empty?
  • find in list
  • get list element
  • set list element
  • get sublist


»create list«

The block »empty list« creates a list with no content.The block »list« generates a list with some predefined values.

This block may only be used in the context of a »set variable« block.

Using »+« or »−« enables you to extend or reduce the list at its end.

Settings and input values:

  • List type, »Number«, »String«, »Boolean«, »Colour«, »Connection«.
  • Create further list element, append to the end of the list.
  • Delete list element at the end of the list.
  • Values, according to the list type. Here the input of initial values is possible.
Return value:
  • Empty list or list, containing elements of the specified list type.




»repeat element in list«

The »repeat element in list« block generates a list of equal elements.  

Settings and input values:

  • List type, »Number«, »Boolean«, »String«, »Colour« or »Connection«.
  • List element, according to the selected list type. This value will be repeated in the list.
  • Number, defining how often the list element will be repeated.
Return value:
  • List of the specified list type, containing the specified number of equal elements.


»length of«

The »length of« block returns a value which is the length of the list given as parameter. An empty list has a length of 0.

Input value:

  • List, evaluated by an appropriate block.
Return value:
  • Number, number of list elements.


»is empty?«

A list given as parameter will be checked whether it is empty.

Input value:

  • List, evaluated by an appropriate block.
Return value:
  • Boolean, either »true« or »false«.


»find in list«

A list is searched for an item. If the item is in the list, the list position will be returned. If the item is not in the list the result is -1.

Settings and input values:

  • List, that will be examined.
  • Position of the occurrence, either »first« or »last«.
  • Value, list item to be found.
Return value:
  • Number, indicating the position where the element was found in the list.

    Note: Counting list positions will start with 0.


»get list element«

This block accesses an item of a list. Depending on the settings this item may be altered.

A list is given as parameter. Then a drop-down-list specifies what will happen to the list item under consideration.

Settings:

  • List, that is under consideration.
  • Option, action for the element found: »get« reads the element and leaves it unchanged, »get and remove« reads the element and removes it from the list, »remove« just removes the element from the list.
  • Option, position of the element found: »#«, »# from end«, »first«, »last« or »random« .
  • Number, indicating the list position. This input value is not required if »first«, »last« or »random« was selected as position.

    Note: Counting of list positions starts with 0.

Return value:
  • List element that has been found at the specified list position; »undefined«, if the list position does not exist.

    With selection of »remove« there is no return value; instead the list will be shortened by this list element.


»set list element«

In a list given as input parameter one specified element will be replaced by a new value.

Settings and input values:

  • List, that will be changed.
  • Option, action for the element found; »set« changes the element, »insert at« inserts a new element into the list.
  • Option, position for the element to be changed: »#«, »# from end«, »first«, »last« or »random« .
  • Number, indicating the list position. This input value is not required if »first«, »last« or »random« was selected.
    Note: Counting of list positions begins with 0.
  • List element, that will be set or inserted at the selected list position.


»get sublist«

From a list given as parameter a sublist will be created. The sublist contains all those elements that match the further specifications of the block.

Settings and input values:

  • List to be examined.
  • Position, start of the sublist: »#«, »# from end« or »first«.
  • Number, indicating the list position. This input value is not required if »first« has been selected.

    Note: Counting of list positions starts with 0.

  • Position, end of the sublist: »#«, »# from end« or »last«.
  • Number, indicating the list position. This input value is not required if »last« has been selected.

    Note: Counting of list positions starts with 0.

Return value:
  • List, a sublist of the same type as the given list.



Functions [Expert-blocks]

With »Functions« blocks (in Java also called »methods« or »subprograms«) you may create more readable programs. NEPO offers some function blocks:

  • Function blocks with/without input parameters and no return parameter
  • Function blocks with/without input parameters and one return parameter
  • If block to be used within a function

With elementary function blocks you may program simple and complex functions which may be used by function calls. Each programmed function is available immediately as an additional block in the »Functions« category. Those are

  • Function calls with/without input parameters and without return parameter
  • Function calls with/without input parameters and also one return parameter

Depending from the number of input and return parameters the selection of function blocks varies.

A unique name is assigned by NEPO to each new function definition (doSomething, doSomething2, ...). This name may be altered. Overwriting of a defined function is not possible.


»Function blocks with/without input parameters and no return statement«

In a function block with/without input parameter and without return parameter a sequence of program statements will be condensed. The input parameters will be determined by the local variables of the function block. Local variables may be generated by using the »+« sign of the function block. Local variables will not be initialized.

If a function block contains an if-block the function may be terminated before reaching it's end.

The function block is available in the »Functions« category immediately after its definition. Using function blocks improves the readability of complex programs.

Settings:

  • Function name, no special characters and white spaces allowed.
  • Generate new local variables, that will be assigned with the function call.
  • Delete the associated local variable.


  • The name of a function block has to start with a lower case letter. Special characters are not allowed in a function block name.

  • If the function block defines input parameters (local variables), all the parameter slots have to be occupied when calling the function.

Example function with two local variables and no return parameter:

Using the function in a program:


»Function blocks with/without input parameters with return statements«

In a function block with/without input parameter and with return parameter a sequence of program statements will be condensed. The input parameters will be determined by the local variables of the function block. Local variables may be generated by using the »+« sign of the function block. Local variables will not be initialized. After running through all the blocks of the function a value will be returned.

If a function block contains an if-block the function may be terminated before reaching it's end. An alternative value may be returned by the if-block.

The function block is available in the »Functions« category immediately after its definition. Using function blocks improves the readability of complex programs.

Settings:

  • Function name, no special characters and white spaces allowed.
  • Generate new local variables, that will be assigned with the function call.
  • Delete the associated local variable.
  • Data type for the return value; choose one data type.
  • Block, that returns a value of the defined data type.
Return value:
  • Value of the defined data type, evaluated in an appropriate block.

  • The name of a function block has to start with a lower case letter. Special characters are not allowed in a function block name.
  • If the function block defines input parameters (local variables), all the parameter slots have to be occupied when calling the function.


»if block to be used within a function«

The if statement within a function is of special importance. As the function sequence meets an if statement the validity of the condition will be checked.

If statement within a function with return value:

  • If the condition evaluates to »true« the rest of the function will be ignored and the function terminates. The second input value of the if statement will be returned. A possibly defined return value of the function will be ignored. The return value data type is determined by the return data type of the function definition.
  • If the condition evaluates to »false« the sequence of the function blocks will be continued. The return value of the function will be returned after reaching the end of the function.

If statement within a function with no return value:

  • An if statement within a function without return value has just the if statement as input parameter.
  • If the condition evaluates to »true« the rest of the function will be ignored and the function terminates.
  • If the condition evaluates to »false« the sequence of the function blocks will be continued.

Settings and input values:

  • Boolean value, possibly evaluated by a condition.
  • Value of the specified data type.



Return value:

    Value of the specified data type.


Example: If x > 5 the function terminates and returns "Winner" and there will be no movement of the robot. Otherwise the robot drives some distance and the function returns "Loser".





Colours

In the colours category you can find all colours, the calliope is able to display with its  status-LED.

Furthermore you can create own colours, using their red, green and blue proportion.


 

»Colour with red, green, blue« [Expert block]

You can create new colours using the  »colour with red, green, blue« block. With this block you can define the percentage of red, green and blue in your colour.

Input values:

  • Number; red proportion
  • Number; green proportion
  • Number; blue proportion








Images

The category »Images« includes blocks, which can be used to select predefined images or create own ones.




 

»create image« 

You can use the block »create image« to create images, which can be displayed on the Calliope. Every single light is  represented by a dot in the grid.

You can type in a number between 0 and 9 to adjust the brightness of the light or just a »#« to turn it on. Every empty field represents a turned off light.

Input value:

  • Number; brightness of the light in the grid.




»image« 

By using the »image« block you can select predefined images.

Settings:

  • Image, predefined image.




»invert image« [Expert block]

An image will be inverted. Lightened LEDs of the calliope display will be switched of and vice versa.

Input value:

  • Image to be inverted
Return value:
  • Image, the inversion of the input image




»shift image ...« [Expert block]

An image will be shifted by some positions on the Calliope display. You may select the shift direction and the amount of shifting.

Input values and settings:

  • Image to be shifted
  • Direction of shifting; up, down, left or right
  • Number, amount for shifting
Return value:
  • Image, shifted





Messages [Expert blocks]

Calliopes can exchange messages.

You can send a message to every Calliope in reach and receive messages from other Calliopes.




 

»send message« [Expert block

Using the  »send message« block you can send a message, which can be received by every Calliope in reach.

Input value:

  • Text; message to be send





 

»receive message« [Expert block

With the »receive message« block you can receive messages, sent by other calliopes in reach and »tell« them to another block.

Performing the »receive message« block the Calliope is not waiting for a message, so it wont receive a message, if none was sent.

Settings:

  • message type, »String«.




  • No labels