Dashboard

More about jBlocks can be found on the Environment page. There are special blocks for sending and receivng values on the jBotBrain II computer.

Group Outputs

LED display

LED display displays received integer or floating point number. It is possible to change display's color, default visible value, number of digits and to turn the display off until first numerical value is received.

It is necessary to change format string after changing digits count. The format string allows to change number of visible digits, precision etc. Its syntax is similar to syntax of function printf (C/C++, PHP, Python,…) or method String.format (Java).

Format string syntax

Syntax of the format string is (parameters in brackets are optional):

%[modifier][digits_count][.precision]date_type
  • modifier can be '-' for left padding, ' ' for adding space before positive value or '0' for right padding with leding zeros.
  • digits_count specifies length of the resulting string. If the rel digits count is lower then given parameter, the resulting string is right aligned with leading spaces (or zeros if parameter modificator is set to zero)
  • precision is number of digits after decima point. It must not be present when formatting integer.
  • date_type must be specified and is 'd' for integer or 'f' for floating point number.

Examples

Format string Value Output
%d 42 „42“
%f 4.2 „4.200“
%4d 42 “ 42“
%04d 42 „0042“
%.1f 42.2 „42.2“
%5.1f 42.2 “ 42.2“
%05.1f 42.2 „042.2“
%.0f 42.2 „42“

Time graph

Time graph shows the value of corresponding floating point number variable in time. It is possible to change limits of both axes as well as their format strings. The time is displayed in seconds.

The graph can be sliding, which means the time on time axis is variable. In the other case the time is constant which is helpful for displaying transient responses (for example motor speed vs. time after it was turned on).

If start in t=0 is selected, the time will correspond to the time since the jBotBrain II started. In the other case zero on time axis means time of first received value.

Analog meter

Analog meter displays floating point number. It is possible to change the hand's color, range of the meter, default value and displayed unit.

If step change is selected, the movement of the hand will not be animated and its position will be changed immediately after receiving value.

LED diode

LED diode is simpple display for a logical value (true/false). It is possible to change color of the diode. The displayed value can be inverted.

RGB LED diode

RGB lED diode displays arbitrary color. The color is set given by intensity of three color channels. Setting the clolor to black (000000) means turning the diode off (the default state). It is possible to change the default color.

Color format

The color is string of six characters with intensities of three color channels (RGB): red, green and blue. Intensities are hexadecimal numbers in range 00-FF (decimal 0-255).

Examples: 000000 je black, FFFFFF white, FF0000 red, 00FF00 green a 0000FF blue.

LED bar

LED bar displays integer value in range 0-100 as ten color bars. Value 0 means all bars are off, value higher than 90 means that all bars are on.

LCD display

LCD display displays received text strings on four lines. The newest message is on the last line. After filling whole display the first line is removed and display's content is scrolled.

RGB LED matrix

RGB LED matrix displays color pixels in matrix with specified dimensions (up to 32×32). It is also possible to set size of the panel.

The panel receives strings in format

<color>column;row;color</code>

where column (numbered from left to right, first is zero) and row (numbered from top to bottom, first is zero) is the pixel's position and color is a string in format RRGGBB, similar to panel RGB LED diode. Setting the color to black (000000) means turning the pixel off (default state).

Example: String value 0;0;00ff00 sets the topmost and leftmost pixel to red color.

Buzzer

Buzzer allows any tone to be palayed for given delay (in milliseconds). The tone value can be send as:

  • String („C4“, „B5“, …)
  • Numerical constant (there is a special block for it, constants are same as in Java class jBotBrain2.hw.Sound, i.e. Sound.C4 or Sound.B5)
  • Logical value (when true is received the configurable default tone is played)

Available tones are: C4, D4, E4, F4, G4, A4, B4 (H4), C5, D5, E5, F5, G5, A5, B5 (H5), C6.

Label

Label allows labeling panels in a Dashboard. It is possible to change its width. If the real text width is lower then the specified minimum width, the text is centered.

The gray dashed border is not displayed in resulting Dashboard.

Group Inputs

Button

Button sends logical value after being clicked. The logical value is true if the button is pressed. It is possible to invert the value or change button's color.

Switch

The operation of Switch is similar to Button, but its logical value is hold. The switch is therefore suitable for turning things on and off. It is possible to change the switch's color or its default state (off or on).

Sliding potentiometer

Sliding potentiometer sends integer value after position of the slider was changed. The value is in range 0..100 and is proportional to posision of the slider. Value grows from left to right. It is possible to change color of the slider.

Potentiometer

Potentiometer sends integer value after position of the slider was changed. The value is in range 0..100 and is proportional to posision of the slider. Value grows clockwise and its maximum value is in the „12 o'clock“ position.

It is possible to change color of the slider. If the without stop parameter is selected, the slider will rotate without being stopped at 0 or 100 position.

Group Animations

Motor

The Motor panel is an animation of direct current motor. Its speed is given as integer value in range -100..100, where -100 and 100 are maximum speeds (counterclockwise and clockwise respectively) and 0 means the motor is stopped. It is possible to change the default speed.

Servo

The Servo panel is an animation of standard hobby servo. The horn position equals to integer value in range 0..100, where 0 means -90 degrees (left), 100 means +90 degrees (right) and 50 is the default center value.

If step change is selected, the horn's movement is not animated and its position is changed immediately after receiving numerical value.

Group Files

File input

The File input panel is used for reading values from a text file. The file path can be either absolute or relative. Relative paths can be used only when the Dashboard is run as a standalone application.

The panel waits for number of lines to be read (therefore its functionality is input and output at the same time). The EOF label is sent when end of file is reached.

Values in the text file can be either numbers (one value per line) or text strings. However, text strings need their own processing program.

File output

The File output panel is used for saving values into text file panel_name.txt, which is created in the same directory as currently running Dashboard. The Dashboard must be run as standalone applicatio in order to create the file.

Received values are written as single lines. It is possible to include a timestamp, which is number of milliseconds since the jBotBrain II was started. In this case the timestamp is located before variable's value and is divided by specified timestamp separator. The resulting file can be opened in Excel, Matlab or similar application (using the CSV file import functionality).

Nahoru