studuino programming environment manual - robotshopstuduino programming environment manual ver 0.9.7...
TRANSCRIPT
Studuino Programming
Environment
Manual
Ver 0.9.7
Jun. 02, 2014
This manual explains the Studuino Programming Environment and how to use it.
As the Studuino Programming Environment develops, this manual may be edited or
revised.
Index
1. Robotist and Studuino Programming Environment ................................................. 1
1.1. Overview and Features ............................................................................................ 1
1.2. System Requirements.............................................................................................. 2
1.3. About Studuino ........................................................................................................ 2
2. Introduction ............................................................................................................ 4
2.1. Installing the Software.............................................................................................. 4
2.2. Starting the Software ............................................................................................... 4
2.3. Uninstalling the Software ......................................................................................... 5
3. The Startup Screen ................................................................................................ 6
4. Studuino Icon Programming Environment .............................................................. 7
4.1. Overview and Features ............................................................................................ 7
4.2. The Icon Palette ....................................................................................................... 8
4.3. The Program Field ................................................................................................... 9
4.4. The Attribute Field .................................................................................................. 15
4.5. The Main Menu ...................................................................................................... 20
4.6. Context Menus ....................................................................................................... 30
5. Studuino Block Programming Environment .......................................................... 31
5.1. Overview and Features .......................................................................................... 31
5.2. The Command Group Palette and Block Palette .................................................. 32
5.2.1. About Block Programming .............................................................................. 32
5.3. The Script Field ...................................................................................................... 42
5.4. The Condition Field ................................................................................................ 43
5.5. The Main Menu ...................................................................................................... 43
5.6. Context Menus ....................................................................................................... 52
6. Troubleshooting ................................................................................................... 52
6.1. General Troubleshooting ....................................................................................... 52
6.2. Studuino Icon Programming Environment ............................................................. 54
6.3. Studuino Block Programming Environment ........................................................... 55
Version History
Version Changes
0.9.7 ■ Added description of servomotor delay block. (page 36)
■ Added error description for function, variable and list names which use
non-alphanumeric characters. (page 40, 49)
1
1. Robotist and Studuino Programming Environment
1.1. Overview and Features
Robotist consists of Studuino, Artec blocks, parts, and the Studuino Programming
Environment. You will be able to create robots with original looks and functions by
combining Studuino, Artec blocks, and other parts. The robot will move according to the
program you created in the Studuino Programming Environment.
The Studuino Programming Environment is designed so that even beginners can
easily create an advanced robot control program. Simply drag and drop the icons or blocks
that control your robot into the Program Field. These programs are Arduino compatible.
Programs created in the Studuino environment can be translated into Arduino language,
where you can design even more advanced programs.
Arduino compatible
Studuino
Artec Blocks
Parts
buzzers, sensors
Studuino
Programming Environment
Create a robot by
combining blocks
and parts.
Studuino is suitable for any
programmer, from beginner
to advanced.
2
1.2. System Requirements
Item Specifications
OS Windows XP (SP2 or later) / Vista / 7 / 8 / 8.1
Processor (CPU) Pentium 4, 2 GHz or higher (or equivalent) recommended
Memory 256 MB or higher
USB USB2.0 port
Software Microsoft .NET Framework 4.0 required (automatically installed with
the Studuino software)
Display XGA (1024×768) or higher
1.3. About Studuino
This section covers the Studuino connectors used when making a robot.
① DC motor connectors
These connectors are for DC motors. Up to two DC motors can be connected.
The connector names are M1 and M2.
② Servomotor connectors (multiple-pin digital connector)
These connectors are for servomotors. Up to 8 motors can be connected. The
connector names are D2, D4, D7, D8, D9, D10, D11, and D12. When a
servomotor is connected, the signal wire (gray wire) must be on the inner side,
as shown above.
①
②
⑥
③
⑦
⑤
④ Black Black Gray
Gray Black Black
3
③ Sensor/LED/Buzzer headers (multiple-pin analog connector)
These 12-pin connectors are for sensors, LEDs, or buzzers. Each connector has
3 pins. The connector names are A0-A7. Any sensor (other than touch sensors
or accelerometers) can be connected to connectors A0-A7. Touch sensors, LEDs,
and buzzers can be connected to A0-A5. Accelerometers can only be connected
to connectors A4 and A5. When a sensor/LED/buzzer is connected, the signal
wire (gray wire) must be on the inner side, as shown in [Connection example 2].
④ Push-button switches
These are button switches. (?)The connector names are A0-A3.
Sensor/LED/buzzer connectors A0-A3 cannot be used with a push-button
switch.
⑤ Reset switch
This switch resets the board. Press this switch to restart Studuino when it is
initialized but does not operate properly or the PC does not recognize it.
⑥ Power supply connector (external power connector)
Connects to a power source. Sensors/LEDs/buzzers/switches can use voltage
supplied by USB, but DC motors and servomotors require power from the power
jack. Connect a battery box to the power jack when USB is disconnected.
⑦ Communication jack (USB mini B connector)
Connects to a cable for PC communication. The included USB mini-B cable can
be replaced with a commercially available one.
The following connectors or switches cannot be used at the same time:
DC motor connector M1 and servomotor connector D2, D4
DC motor connector M2 and servomotor connector D7, D8
Push-button switch A0 and sensor/LED/buzzer connector A0
Push-button switch A1 and sensor/LED/buzzer connector A1
Push-button switch A2 and sensor/LED/buzzer connector A2
Push-button switch A3 and sensor/LED/buzzer connector A3
For example, you can’t use a DC motor connected to M1 while a servomotor is
connected to D2 or D4. They may not work properly due to interference. Likewise using a
servomotor connected to D2 or D4 while a DC motor is connected to M1 may cause the DC
4
motor to malfunction.
2. Introduction
2.1. Installing the Software
Download a zip file containing the Studuino software from
http://www.artec-kk.co.jp/en/studuino. Decompress the zip file, find and double-click
setup.exe to install the software. Microsoft .NET Framework 4 is required to use this
software. If .NET Framework 4 is not already on the system, it will be automatically installed
before Studuino.
This software will be installed in the following location. The user name will be in the red
[username] area, and in [***] a unique alphanumeric string will appear.
Windows XP
C:\Documents and Settings\[username]\Local Settings\Apps\2.0\[***]\[***]\[***]
Windows Vista / 7 / 8
C:\Users\[username]\AppData\Local\Apps\2.0\[***]\[***]\[***]
2.2. Starting the Software
Windows XP / Vista / 7
Select Studuino Programming Environment, which will appear in the Start menu
after installation is completed. If you do not see the icon in the Start menu, choose All
Programs, go to the Artec Co., Ltd. folder and select Studuino Programming
Environment.
The Studuino Programming Environment startup screen will appear.
5
Windows 8
Select Studuino Programming Environment on the start screen. The Studuino
Programming Environment startup screen will appear.
2.3. Uninstalling the Software
Windows XP
Open Control Panel and select Studuino Programming Environment from
Add or Remove Programs. Click Change/Remove.
Windows Vista/7
Open Control Panel and select Uninstall a program. Next, select Studuino
Programming Environment and click Uninstall or change a program.
Windows 8
Click the desktop tile on the bottom left of the Start screen to show the desktop.
Right-click the bottom left corner to show the system management menu and
select Programs and Features.
On the Programs and Features screen, select Studuino Programming
Environment and click Uninstall or change a program.
6
3. The Startup Screen
The Studuino Programming Environment opens with the screen shown above.
Icon Programming Environment
Clicking on the Icon Programming Environment will start the software and allow you to
make a program to control your robot. For more details on programming a robot using the
Studuino Icon Programming Environment, see 4. Studuino Icon Programming Environment.
Block Programming Environment
Clicking on the Block Programming Environment will start the software and allow you to
make a program to control your robot. For more details on programming a robot using the
Studuino Block Programming Environment, see 5. Studuino Block Programming
Environment.
Language Settings
Select Language Settings from the main menu to change the software language to
Japanese, English, or Chinese.
Exit
The Start screen will exit when you select Exit from the main menu.
Click "Back to Main Menu" at the bottom left of the screen to go back to the main menu
from any page.
7
4. Studuino Icon Programming Environment
4.1. Overview and Features
The Studuino Icon Programming Environment is designed for creating a program to
control your Artec robot by dragging & dropping icons into the Program Field. Each icon in
the Program Field can have a detailed operation mode specified in its Attribute Field. A
full-fledged robot control program can easily be created by using Test (refer to Test Mode in
4.5. The Main Menu). Test mode provides real-time control of your robot. You can also
check sensor-input values with the Sensor Viewer (refer to Sensor Viewer in 4.5. The Main
Menu).
After creating a program, transfer it to your Studuino and execute it by clicking the
(Transfer) icon. The control program can also be converted to Arduino language for editing
using the Arduino IDE (refer to Display Arduino Language in 4.5. The Main Menu).
Icon Palette
Program Field
Attribute Field
Program /Transfer
8
4.2. The Icon Palette
Robot control icons are provided in the Icon Palette. The Operation group contains robot
action icons, the Sensor group contains icons that control sensor values, the Repeat group
contains icons that control program loops, and the Submenu group contains icons that run
submenu items.
The following section explains the different types of icons in each group.
Operation Group
The Operation group contains icons that control robot parts.
Controls DC motors
Controls servomotors
Controls a single LED
Buzzer plays a melody
Sounds a single note from
the buzzer
Waits for a specified time
As shown below, when two DC motors are connected to M1 and M2 as car wheels
you can use icons to control the movement of your car. The wheels should be in front.
Repeat
Motion
DC Motor
Buzzer LED
Servomotor
Wait
Sensor Submenu
Connect to
M1
Connect to
M2
Forward
9
Forward
Backward
Left turn (F)
Left turn (B)
Right turn (F)
Right turn (B)
Rotation
Sensor Group
In the Sensor group there are icons that use sensor values as conditions for robot
movements.
Do not use sensor values as conditions for robot movements
Use one sensor value as a condition for robot movements
Use two sensor values as conditions for robot movements
Repeat Group
The Repeat group contains icons that are used to repeat a part of the process.
Repeat start
Repeat end
Submenu Group
The Submenu group contains icons that run a specific process from a submenu.
Run Submenu 1
Run Submenu 2
4.3. The Program Field
Drag & drop
Operation
Menu tabs
10
The Program Field is used to create robot control programs by dragging & dropping
control icons into the Icon Palette. Each column is treated as one operation. Use the tabs at
the top to switch between the Main menu, Submenu 1, and Submenu 2.
Menu
The menu is used to create programs for your robot. A total of 24 operations can be
programmed. The programs you create are executed in numerical order. The menu, from
top to bottom, contains boxes for Repeat, Operation, and Condition icons. Place Repeat
icons in Repeat boxes, icons from the Operation or Submenu group in Operation boxes, and
icons from the Sensor group in Condition boxes.
Repeat Icon Boxes
Icons from the Repeat group can be dragged and dropped into Repeat boxes. Follow
the steps below to set Repeat icons.
① Drop a Start Repeat icon in the loop box of the
operation which you want to repeat (flashing).
② Drop an End Repeat icon in the Repeat box of
the operation where you want the loop to end
(stop flashing). Repeat segments will be
enclosed in a purple rectangle.
11
③ After dropping ②, a Repeat Settings dialog box
will appear where you can enter the number of
times you want the loop to repeat. If you check
Repeat indefinitely, the loop will repeat an
endless number of times.
③ You have now made a loop. To change the
number of times the loop repeats, click the End
Repeat icon (stop flashing) and the Repeat
Settings dialog box will reappear.
Operation Icon Boxes
Icons from the Operation and Submenu groups can be dragged and dropped into
Operation boxes. Submenu icons are used to execute operations set in Submenu or
of the Program Field (see the Submenus section for details).
Also, you can copy any icon in an Operation box by dragging and dropping it into an
empty box. As shown below, copied icons will retain the attributes of their parent icons.
Attributes for #1
Attributes for #2
Drag & drop
Copied icons retain the
attributes of the parent icon
12
Condition Icon Boxes
When an icon is dropped in an Operation box, a no condition icon is created in the
Condition box automatically. By dropping an icon from the Sensor group into the Condition
box, sensor input values can be used as conditions for the operation. Sensor or threshold
values which are used for the condition can be set in the Attribute Field. Selecting a Sensor
icon with a condition allows you to modify that condition in the Attribute Field. Please refer to
4.4. The Attribute Field for details on how to modify conditions for Sensor icons.
The above picture shows a program which has an unconditional operation that makes
the car move forward in box 1, but a conditional operation in step 2 that makes the car move
backwards if value of the Light sensor is less than 3. This operation will not run if the value of
the Light sensor is greater than 3.
Submenus
Smaller programs of up to 8 operations can be created in Submenus. When a Submenu
Moves the car
forward
When a condition is set, it
executes along with the
operation in the same
column
Conditions are
modified in the
Attribute Field
A no condition icon is
set automatically
Placing a Submenu icon in the main
menu will run operations in the
Submenu
Operations
Conditions
13
icon is placed in the Main menu, programs created in the Submenu are executed in
numerical order. There are Operation and Condition boxes in Submenus. Operation group
icons are placed in Operation boxes and Sensor group icons in Condition boxes.
Selecting and Placing Multiple Icons
Multiple icons in the Program Field can be copied by selecting and dragging & dropping
them into another box.
Click in the blue area outside the Operation, Condition, and Repeat boxes and your
icon will change to . Drag your cursor to create a selection box around the icons you want
to copy. Release the left mouse button once you have selected the icons and your cursor
will return to normal.
★ Only Operation icons can be selected. Empty boxes and Submenu icons will not be
included in your selection.
Now we will drag the icons to a new space. Your mouse cursor will change to the
first icon in the selection.
Dragging the icons to another space will copy them. Dragging your cursor to a
different menu tab will switch to that menu. Dragging the icons to boxes in a different menu
Mouse cursor
changes into a hand
Selection box
appears as a dotted
line
Dotted line turns
solid once selection
has been made
Mouse cursor returns
to normal
Only Operation icons
can be selected
14
tab will copy them there.
★ Copying Operation icons will also copy any Condition icons that you have set for them.
Dragging Operation icons with no condition will set a no condition icon for them.
Drag icons to a tab to
switch tabs and drop
them in an empty box
Drag and drop
Operation icons
15
4.4. The Attribute Field
Each Control icon has unique attributes. For example, a Motion icon for a car has
information on speed, duration, and so forth. This information can be modified in the
Attribute Field. When an icon in the Program Field is selected, the attributes of the selected
icon are displayed in the Attribute Field where they can be changed.
The following section explains attributes for different icons.
Motion Icons 1
Attribute Description
Speed Set movement speed from 0-10.
Time Set movement time from 0.1 to 25.5 sec.
Brake Use this setting to stop your robot.
This is useful for when you need to make your robot stop at a certain place.
Without using Brake, your robot will run its program and coast to a stop.
Your robot will smoothly transition between movements if you do not use
Brake.
Selecting an icon will show its
settings in the Attribute Field
16
Motion Icons 2
Attribute Description
Speed Set movement speed from 0-10.
Rotation Set a left or right turn.
Time Set movement time from 0.1 to 25.5 sec.
Brake Use this setting to stop your robot.
This is useful for when you need to make your robot stop at a certain place.
Without using Brake, your robot will run its program and coast to a stop.
Your robot will smoothly transition between movements if you do not use
Brake.
DC Motor Icon
Attribute Description
Connector Sets which connector the DC motor is connected to. Refer to Port Settings
in 4.5. The Main Menu to see which connectors you can use.
Rotation Sets the rotation direction (forward or backward).
Rotation
Speed
Sets the rotation speed of the DC motor from 0-10.
Time Set movement time from 0.1 to 25.5 sec.
Brake Use this setting to stop your DC motor.
This is useful for when you need to make your robot stop at a certain place.
Without using Brake, your robot will run its program and coast to a stop.
Your robot will smoothly transition between movements if you do not use
Brake.
17
Servomotor Icon
Attribute Description
Angle Check the box for each motor to set an angle from 0 to 180 degrees in one
degree increments. Refer to Port Settings in 4.5. The Main Menu to see
which connectors you can use.
Speed Sets five levels of speed for the selected angles.
LED Icon
Attribute Description
Switch Turns the LED on or off.
Connector Sets which connector an LED is connected to. Refer to Port Settings in 4.5.
The Main Menu to see which connectors you can use.
Buzzer Icon
Attribute Description
Sound Sets a note to play with a length of 0.1 to 1.0 seconds.
Connector Sets which connector a buzzer is connected to. Refer to Port Settings in
4.5. The Main Menu to see which connectors you can use.
18
Melody Icon
Attribute Description
Compose Add notes by scale or rests by selecting them and pressing the → key. A
tempo of either 90, 120, or 150 can be selected. Each icon can hold eight
notes and/or rests.
Connector Sets which connector a buzzer is connected to. Refer to Port Settings in
4.5. The Main Menu to see which connectors you can use.
Wait Icon
Attribute Description
Time Waits for a specified length of time. Set wait time from 0.1 to 25.5 sec.
Single Sensor Condition Icon
Attribute Description
Condition Set a condition threshold by using the combo box to choose a sensor
connected to the Studuino, and select the type of condition (equality (=),
inequality (< >), or range (|→←|, ←||→)). Ranges are open intervals and do
not include the threshold numbers. The picture below shows the combo
box and the sensors connected to the Studuino. Refer to Port Settings in
4.5. The Main Menu to see how the sensors will be displayed.
19
Dual-condition Icon
Attribute Description
Condition Set a condition threshold by using the combo box to choose a sensor
connected to the Studuino, and select the type of condition (equality (=),
inequality (< >), or range (|→←|, ←||→)). Ranges are open intervals and do
not include the threshold numbers. A Dual-condition icon has an extra
combo box for choosing an if/else statement.
The picture below shows the combo box and the sensors connected to the
Studuino. Refer to Port Settings in 4.5. The Main Menu to see how the
sensors will be displayed.
20
4.5. The Main Menu
File Menu
You can use the File menu to save and load files.
Open
Open a previously saved file.
Save
Saves the program you're currently working on and overwrites the previous
version.
Save As
Saves the program with a specified name.
Exit
Closes the Studuino Icon Programming Environment.
Edit Menu
The Edit menu can be used to modify your program.
Undo
Undoes your last action.
The software will remember the last 10 actions you've performed, including placing
icons, inserting and deleting columns, and changing port settings.
Reset
Removes all icons from the Program Field.
21
Show Arduino Language
Converts the program in your Program Field to Arduino language. The source code
you export using this feature can be compiled and sent to your Studuino using the
Arduino IDE.
Motor Calibration
Use this feature to adjust the angles of your servomotors and the speed of your DC
motors and save the settings to a file. Running this feature will start Test mode and
open the Motor Calibration dialog box.
Servomotor Calibration
When the dialog box opens, all angles for the connected servomotors are set to 90
degrees by default. Entering an offset value from -15 to 15 degrees will set the angle for
the corresponding servomotor to 90 degrees + the offset value.
Watch your servomotors and adjust the values until you get the correct 90 degree
angle.
Click OK when you have finished calibrating your servomotors. Saved settings will
be used for future programs.
Enter offset values here
Returns all offset values to 0
22
DC Motor Calibration
Once the dialog has opened, click Rotate and the two DC motors will begin rotating
at their highest speed. Use the sliders to adjust the motors and make them move at the
same speed. Clicking Stop will stop the motors and enable the OK and Cancel buttons
again. Click OK. Saved settings will be used for future programs.
Port Settings
Opening Port Settings allows you to see the parts connected to your Studuino in
the Studuino Icon Programming Environment. Clicking on this feature will show the Port
Settings dialog box.
As shown in the picture below, this dialog box shows all Studuino connectors and
Use the slider to adjust the
speed of the motors.
Click here and the motors will begin
rotating at maximum speed.
23
switches on the Studuino. Check any which have a part connected to them.
24
As described in 1.3. About Studuino, DC motor connector M1 and servomotor
connectors D2 and D4, DC motor connector M2 and servomotor connectors D7 and D8,
push-button switches A0-A3 and sensor/LED/buzzer connectors A1-A3 cannot be used
at the same time. As these combinations also cannot be used at the same time in the
Port Settings dialog, please uncheck one side while the other is active. For example,
when using D2 and D4 for the servomotor, the checkboxes for D2 and D4 would only be
available by unchecking M1 for the DC motor.
<Caution>
For an accelerometer, which uses two connectors, all of the corresponding
connectors should be checked.
Part Connector Combination
Accelerometer A4, A5
Connector combination when multiple connectors are used
When the checkboxes of the corresponding connectors under Connector
Combination above are checked, the part connected to the Studuino will be displayed.
Checking one box for a part which uses multiple connectors will automatically select the
boxes for any other connectors it’s using.
Servomotor Button DC motor
Sensor/LED/buzzer
25
Run Menu
The Run menu allows you to link with your Studuino while making programs.
26
Transfer
Transfer compiles any program you've made and sends it to your Studuino. You
can also access Transfer by clicking on the button between the Program Field and
Icon Palette.
Make sure that your Studuino is connected to your PC via
a USB cable before transferring your program. You'll see a
status bar like the one to the right while your program transfers.
This status bar will disappear once the program has transferred.
Messages will also appear if there is a communication error between your PC and
Studuino. See below for details on these messages.
This message appears if communication
between the PC and Studuino is interrupted
during a transfer. The error that causes this
message may cause the Studuino Icon
Programming Environment to close without
warning. Save your data and restart the software.
This message appears when there is no
connection between your PC and Studuino. If
you see this message, check the connection
between your PC and Studuino and try
again.
This message appears when another
application is interfering with communication
between your PC and Studuino. Close any
applications which may be causing this error
and try again.
Run
Run executes any program you've transferred.
27
Test Mode
Click on Test or the button between the Program Field and Icon Palette to start
Test mode. You can use Test mode to communicate with your Studuino and control
parts in real time. Test mode can be used to adjust icon settings in order to fine tune
your robot. The table below describes each Test mode icon.
Icon Description
Motion Click on any Motion icon in the Program Field to see its movement settings.
DC Motor Click on any Motion icon in the Program Field to see its movement settings.
Servomotor
Click on any Motion icon in the Program Field to see its angle settings. You can
also check angle settings in real time using the Attribute Field.
★Changes to speed settings will not be recognized in Test mode.
LED Changing LED settings will turn them on and off.
Buzzer The buzzer will sound notes when changed in the Attribute Field.
Melody
Click on any Melody icon in the Program Field and the buzzer will play the
melody. Your robot will also play notes selected in the Attribute Field using its
buzzer.
Make sure your PC and Studuino are connected before
starting Test mode. You will see a message like the one to
the right when initiating Test mode. This message will
disappear once Test mode has started. Messages will
appear if there is a communication error between the PC
and Studuino when starting Test mode. See below for details on these messages.
This message appears if communication
between the PC and Studuino is interrupted
when starting Test mode. The error that
causes this message may cause the
Studuino Icon Programming Environment to
close without warning. Save your data using the dialog box.
This message appears when there is no
connection between your PC and Studuino. If
you see this message, check the connection
between your PC and Studuino and try
again.
28
This message appears when another
application is interfering with communication
between the PC and Studuino. Close any
applications which may be causing this error
and try again.
Sensor Viewer
The Sensor Viewer is used to communicate with your Studuino and check the values of
any sensor connected to the unit.
Make sure your PC and Studuino are connected before opening the Sensor Viewer.
When starting the Sensor Viewer you will see a similar status bar to the one that
appears when initializing Test mode. This message will disappear once the Sensor
Viewer has opened. Messages will appear if there is a communication error between
the PC and Studuino when starting the Sensor Viewer. See below for details on these
messages.
This message appears if communication
between the PC and Studuino is interrupted
when starting the Sensor Viewer. The error
that causes this message may cause the
Studuino Icon Programming Environment to
close without warning. Save your data using the dialog box.
Shows the values for
connected sensors.
29
This message appears when there is no
connection between your PC and Studuino. If
you see this message, check the connection
between your PC and Studuino and try
again.
This message appears when another
application is interfering with communication
between the PC and Studuino. Close any
applications which may be causing this error
and try again.
Help Menu
The Help menu contains information about the Studuino Icon Programming
Environment.
About Studuino Icon Programming
Shows the version of the software you are currently using.
30
4.6. Context Menus
Right-clicking on a box in the Program Field will bring up a context menu.
Delete
Deletes an icon.
Delete a Column
Removes a column and moves other columns to the left.
Add a Column
Inserts an empty column.
31
5. Studuino Block Programming Environment
5.1. Overview and Features
The Studuino Block Programming Environment is a visual programming
environment developed for Robotist. It is based on the Scratch programming environment
developed by the Massachusetts Institute of Technology. Robot control programs can be
created by dragging blocks from the Block Palette and attaching them to other blocks in the
Script Field.
It is possible to create high-level programs as advanced as ones written in other
programming languages (such as C) because blocks support standard programming
elements such as branching, loops, and variables. You can also control your robot in real
time using Test mode. Use Test mode to create a program while checking sensor values
(using the Sensor Board), robot status, and more (see 5.5. The Main Menu).
After you create your program, it can be transferred to Studuino and executed by
clicking Transfer. The finished control program can also be converted to Arduino language
for later editing (refer to Export Arduino Language in 5.5. The Main Menu).
The Studuino Block Programming Environment is described below.
Block Palette Script Field
Condition Field
Command Group Palette
Drag & drop Sensor Board
32
5.2. The Command Group Palette and Block Palette
The Command Group Palette and Block Palette control blocks which are used for
programming. The Block Palette display can be switched by selecting the Command Group
Palette button. The Command Group Palette buttons and blocks which are displayed in the
corresponding Block Palette are described below.
Button Block
Motion Blocks which control DC motors,
servomotors, buzzers, and LEDs
Control
Standard elements of programming such as
branching, loops, functions and processing
blocks
Sensing Blocks which reference sensor values
Operators Blocks which control basic and advanced
arithmetic and logic operators
Variables Blocks which control variables, lists, and
processing for variables and lists
5.2.1. About Block Programming
In the Studuino Block Programming Environment there are two kinds of Blocks, ones with
notches on the top and bottom such as (process blocks) and ones without
notches such as and (setting blocks). Process blocks, used
mainly for processing actions, are attached to create the programs that control your robot.
Blocks with rounded edges such as return values, and are used
mainly to modify the settings of other blocks. Hexagonal blocks such as are used
to set conditions and modify conditional process blocks such as .
attach vertically The speed of the DC motor is set to 100,
moving for one second before stopping.
33
The rounded input box in ① and the hexagonal space in ② can be used to change block
settings.
The rounded input box in ① can accept blocks such as or numerical
input. The hexagonal space in ② can accept a block such as to change the
settings of the block. The following section explains the different types of blocks in the Block
Palette.
Type 15
Creates a block which uses
the sum of the light sensor
and val blocks
This operator checks
whether val is less than 15
Putting together a light sensor value
block and a val blockProcess blocks
Adding a block which checks if the
light sensor value is less than 50 and a
DC motor block to a branch block
This branch will make the DC motor run
if the value of the light sensor is less than
50
Setting a less than (<) operator using
val and an input value of 15
② ①
34
Motion Palette Blocks
Blocks in the Motion Palette are used to control the parts of your robot. Blocks for parts
without Port Settings configured are grayed out and cannot be placed in the Script Field.
Find descriptions of each block below.
Servomotor Control Block
Controls a servomotor connected to your Studuino.
Sets the servomotor connecting with connectors (D2-D12) specified in ① with an angle
(0-180) specified in ②. Any setting with a value less than 0 will be set as 0, and any
value greater than 180 will be set as 180.
DC Motor Control Blocks
Controls a DC motor connected to your Studuino.
Sets the DC motor connected to connectors (M1/M2) specified in ① with the speed
(0-100) specified in ②. The higher the speed value, the faster the DC motor runs. Any
setting with a value less than 0 will be set as 0, and any value greater than 100 will be
set as 100.
Sets the DC motor connected to connectors (M1/M2) specified in ① with a direction
(clockwise/counterclockwise) specified in ②.
Sets the DC motor connected to connectors (M1/M2) specified in ① with a stopping
method (brake/coast) specified in ②.
Connected to Studuino Not connected to Studuino
①
②
① ②
① ②
① ②
35
Buzzer Control Blocks
Sets the buzzer connected to connectors (A0-A5)
specified in ① with an output volume specified in ②.
Click on ▼ in ② to set the note you would like the
buzzer to play. You can select scales ranging from C48 (130Hz) to C108 (4186Hz). You
can also select notes ranging from C48 (130Hz) to C72 523Hz). If you would like to use
scales higher than C72, input them directly using the keyboard. Playing notes with the
buzzer may interfere with the operation of a DC motor connected to M1. If you would
like to use a DC motor connected to M1, use a block to stop the buzzer before attaching
a DC motor block.
The combo box in ① is used to stop any buzzer connected to (A0-A5).
LED Control Block
The combo box in ① is used to turn any LED connected to (A0-A5) on or off.
Control Palette Blocks
Blocks in the Control Palette allow you to control the flow of your program. Find descriptions
of each block below.
This block begins a function. You can name the function using
the combo box in ①.
Use the combo box in ① to call a specific function.
Wait for the number of seconds specified in ①.
The process inserted in ① will loop indefinitely.
① ②
①
① ②
①
①
①
①
①
36
The process inserted in ① will repeat the number of times
specified in ②.
Continuously evaluates whether the condition in ① has been met
and runs the process in ② if it has. The condition in ① is
specified using a block from the Operators Palette.
If the condition in ① has been met, the process in ② is executed.
The condition in ① is specified using a block from the Operators
Palette.
If the condition in ① has been met, the process in ② is executed.
If it hasn't, the block runs the process in ③. The condition in ① is
specified using a block from the Operators Palette.
Waits until the condition in ① has been met. The condition in ①
is specified using a block from the Operators Palette.
The process in ② repeats until conditions for the process in ①
are met. The condition in ① is specified using a block from the
Operators Palette.
This block allows you to control the delay for the servomotor
block inserted in ② by entering a number from 0-20 in ①. This
block only works with servomotor blocks and other blocks will not
be recognized.
①
②
①
②
①
②
①
②
③
①
②
①
② ①
37
Sensing Palette Blocks
Blocks in the Sensing Palette are used to retrieve sensor values. Blocks for parts without
Port Settings configured are grayed out and cannot be placed in the Script Field.
Sensor blocks can be combined with and use the values of other blocks. The picture below
shows a combination of a servomotor block and a light sensor block. This combination
allows you to change the angles of the motor in response to the amount of light in a room.
Find descriptions of each block below.
Returns the value of the light sensor connected
to A0-A7 specified in ①. Sensor value ranges
from 0 to 100.
Returns the value of a touch sensor connected
to A0-A5 specified in ①. Sensor value is 0 when
the sensor is touched and 1 in its normal state.
Returns the value of the light sensor connected
to A0-A7 specified in ①. Sensor value ranges
from 0 to 50.
Returns the value of a reflective infrared sensor
connected to A0-A7 specified in ①. Sensor
value ranges from 0 to 100.
Connected to Studuino Not connected to Studuino
Combine sensor
blocks with other
blocks that accept
input.
①
①
①
①
38
Returns the value of a specified direction (X/Y/Z
axis) from a connected accelerometer. Sensor
value ranges from 0 to 100.
Returns the value of a push-button switch
connected to A0-A3 specified in ①. Sensor
value is 0 when the button is pushed and 1 in its
normal state.
Operators Palette Blocks
Blocks in the Operators Palette perform calculations using the values you input. Find
descriptions of each block below.
Adds the values set in ① and ②. Arithmetic operation
blocks include subtraction (-), multiplication (*), and
division (/) blocks. You can select the other arithmetic
operators from the context menu by right-clicking on
the block.
Returns a random number between the values set in ① and ②.
Determines whether the value set in ① is less than the
value set in ②. The other comparative operators find
whether the values are equal (=) or whether a value is
larger (>). You can select the other comparative
operators from the context menu by right-clicking on
the block.
The picture below shows a combination of a light sensor, condition, and servomotor block.
You can use this to set the servomotor angle to 90 degrees if the light sensor value dips
below 50.
①
①
② ①
② ①
② ①
39
This block is an AND operator using the conditions
set in ① and ②. The other logical operator blocks
are OR and NOT. You can select the other logical
operators from the context menu by right-clicking
on the block. The picture below shows a combination of a logical operator, condition, and
DC motor block. You can use this combination to make the DC motor move forward when
the sound value is between 30 and 60.
② ①
40
This modulo block divides ① by ② and returns the remainder. As with the block,
right-clicking on this block will allow you to select other arithmetic operators from the context
menu.
This block returns the nearest integer (whole number) for the value set in ①.
This block uses the value in ① for the specified
arithmetic operation in ②. You can choose from
absolute values, square roots, trigonometric
functions, logarithms, and exponents.
Variables Palette Blocks
Blocks in the Variables Palette are
used to make variables and lists. Click
on the Make a variable button and type
in a name to make a variable. Click on
the Make a list button and type in a
name to make a list. Using
non-alphanumeric (A-Z, a-z, 0-9)
characters in function, variable, and list
names will cause a Build error when
transferring your program (see the
Program/Transfer section in 5.5. The
Main Menu for details). Only use alphanumeric characters (A-Z, a-z, 0-9) for function,
variable, and list names. Values of variables and lists can be from 3.4028235E+38 to
3.4028235E+38, or a maximum of 32 bits (4 bytes).
The following section explains the variable blocks in the Variables Palette (for a variable
named "val").
Returns the value of the variable.
Sets the variable in ① to the value set in ②.
Increases the value set in ① by the value set in ②.
② ①
①
② ①
② ①
② ①Motors, LEDs,
41
You can make up to 70 different variables.
The picture above shows a combination of a loop and a servomotor block. You can use this
to make program that increases the value in the variable "val" by 10, making the process
repeat 10 times and increasing the angle of the motor from 10 to 100 in 10 degree
increments.
Lists are structured blocks which allow you to add or remove values as you see fit. Lists can
hold up to 40 separate values. The following section explains the list blocks in the Variables
Palette (for a list named "list").
Returns the first value in the list.
Adds the value in ① to the list in ②.
Deletes the value in ① from the list in ②.
Inserts the value in ③ to list ① at position ②.
Sets the value at position ② in list ① to the value
set in ③.
Returns in value at position ② in list ①.
② ①
② ①
① ③
②
② ① ③
② ①
42
Returns the length of list ①.
Determines whether list ① includes the value in ②.
The picture above adds the values 10, 20, and 30 from the previous 3 blocks to "list". This
process makes a list that includes 10 in the first position, 20 in the second position and 30 in
the third position. Using this list, you can set the angles of the servomotor in the next blocks.
The servomotor connected to D9 will have its angles set to 10, the servomotor in D10 to 20,
and the servomotor in D11 to 30 degrees.
5.3. The Script Field
The Script Field is where you drag and attach blocks to create your program. The Studuino
Block Programming Environment opens with a Start program block in the
Script Field. This block starts your program. Any program you make must include this block.
①
② ①
Script Field Condition Field
43
5.4. The Condition Field
The Condition Field shows Test mode sensor values, variables, and lists. Starting Test
mode will open the Sensor Board, where you can view the values of any sensor connected
to your Studuino. As shown below, you can also view the change in values of any variables
or lists in the Condition Field by clicking the checkbox to the left of them.
5.5. The Main Menu
File Menu
You can use the File menu to save and load projects.
New
Start a new project.
Open...
Open a previously saved project.
Save
Save your current project.
Save As…
Save your program with a specified name.
Exit
Closes the Studuino Block Programming Environment.
View variables in
the condition field
by clicking here Appears if you
open Test
44
Edit Menu
The Edit menu can be used to modify your program.
Undelete
Restores a deleted block.
Start / Stop Single Stepping
Starts running your program step by step.
When using Single Stepping, the block
currently being processed will turn yellow.
You can change how fast steps run using the
Set Single Stepping... menu.
Set Single Stepping…
Use this to change how fast steps are
processed. Turbo is the fastest speed, and
Flash is the slowest method of processing
steps.
Export Arduino Language…
Converts the program in your Script Field to Arduino language. All blocks in your Script
Field will be converted to Arduino language. The source code you export using this
feature can be compiled and sent to your Studuino using the Arduino IDE.
Any blocks which are not attached to the master or function
blocks will still be converted to Arduino language. Use Arduino IDE to
delete any code from unattached blocks before compiling your program.
45
Blocks which are unattached to functions (orphaned) will still be processed by the
function in the Block Programming Environment, but orphaned code will result in a
compiling error in Arduino IDE. Unset values in blocks such as will be set to 0
when exporting to Arduino language. Unset conditions in blocks such as will
be set to "false" when exporting to Arduino language.
// ---------------------------------------
// Artec robot mainroutine
// ---------------------------------------
void artecRobotMain() {
for (;;) {
ARSR_subroutine();
}
}
// ---------------------------------------
// Artec robot subroutine
// ---------------------------------------
void ARSR_subroutine() {
servomotor(DIG9,90);
}
dcMotorPower(M1,100);
Block Converted to Arduino
Results in a
compiling error
46
Servomotor Calibration
Use this feature to adjust the angles of your servomotor and save them to a file.
Running this feature will start Test and open the Motor Calibration dialog box.
When the dialog box opens, all angles for the connected servomotor are set to 90
degrees by default.
Watch your servomotor and adjust the values until you get the correct 90 degree angle.
Click OK when you have finished calibrating your servomotor. Saved settings will be used
for future programs.
Enter offset values here
Sets all offset values to 0
47
Port Settings
Allows you to see the parts which are connected to your Studuino in the Studuino Block
Programming Environment. Clicking on this feature will show the Port Settings dialog
box.
As shown in the picture below, this dialog box shows all Studuino connectors and
switches on the Studuino. Check any which have a part connected to them.
As discussed in 1.3. About Studuino, the following connectors or switches cannot be
used at the same time:
・ DC motor connector M1 and servomotor connector D2, D4
・ DC motor connector M2 and servomotor connector D7, D8
・ Push-button switch A0-A3 and sensor/LED/buzzer connector A0-A3
As these combinations also cannot be used at the same time in the Port Settings dialog,
Servomotor Button DC motor
Sensor/LED/buzzer
48
please uncheck one side while the other is active. For example, when using D2 and D4
for the servomotor, the checkboxes for D2 and D4 would only be available by
unchecking M1 for the DC motor.
<Caution>
For the accelerometer, which uses two connectors, all of the corresponding connectors
(or a compatible combination) should be checked.
Part Connector Combination
Accelerometer A4,A5
Connector combination when multiple connectors are used
When the checkboxes of the corresponding connectors in Connector Combination
above are checked, the part connected to the Studuino will be displayed. Checking one
box for a part which uses multiple connectors will automatically select the boxes for any
other connectors it’s using.
When an accelerometer is selected with
A4, A5 is selected automatically.
49
Run Menu
The Run menu allows you to link with your Studuino while making programs.
Transfer
Transfer compiles any program you've made and sends it to your Studuino. You will see
a message box like the one in the below picture if a build error occurs.
A build error will occur if there are blocks that are unattached to the master
or function blocks in the Script Field. See below for
details on this message.
This message appears if there are blocks that are
unattached to master or function blocks in the Script
Field. When
preparing to build, please attach or delete any
orphaned blocks in the Script Field before using
Transfer. You will also see this message when any
function, variable, or list names contain
non-alphanumeric characters. Rename your function, list, or variable and try again.
This message appears if there are any undefined
function blocks in your program. As shown below, any
blocks which call
functions must
have the function defined. When you're prepared to
build your program, place and define a
function block in the Script Field, or
delete any orphaned function blocks before using Transfer.
Title
Message
[An undefined function]
[Unattached blocks]
50
This message appears when the two error messages
described above occur at the same time. When
preparing to build, please attach or delete any
orphaned blocks and define functions for blocks which use them before using Transfer.
Once you have built your program you can transfer it to your Studuino. See below for
details on messages you'll see when transferring your program.
This message appears during a program
transfer. Do not disconnect your Studuino
from the PC when transferring a program. If
communication between your Studuino and PC is interrupted during a transfer you will
see the below messages.
This message appears if
communication between the PC and
Studuino is interrupted during a transfer.
Reconnect your Studuino to the PC and try again.
This message appears when there is no
connection between your PC and Studuino.
If you see this message, check the
connection between your PC and Studuino
and try again.
This message appears when another application is
interfering with communication between the PC and
Studuino. Close any applications which may be
causing this error and try again.
Run
Run executes any program you've transferred. This appears in the menu after you have
successfully transferred a program.
Test Mode
51
You can use Test mode to communicate with your Studuino and control parts in real
time. Make sure your PC and Studuino are connected before starting Test mode.
Click on Test and you will see the message
to the left telling you that Test mode is being
initialized. Do not disconnect your Studuino
from the PC while in Test mode. If communication between your Studuino and PC is
interrupted during a transfer you will see the below messages or a runtime error may
cause the Studuino Block Programming Environment to freeze. Keep your Studuino
connected to the PC at all times while in Test mode. See below for details on these
error messages.
This message appears if
communication between the PC and
Studuino is interrupted when initializing
Test mode. Reconnect your Studuino to the PC and try again.
This message appears when there is no
connection between your PC and Studuino. If
you see this message, check the connection
between your PC and Studuino and try again.
This message appears when another
application is interfering with
communication between the PC and
Studuino. Close any applications which may
be causing this error and try again.
This message appears if communication between the
PC and Studuino is interrupted during Test mode. Save
your project and restart the software.
Help Menu
The Help menu contains information about the Studuino Block Programming Environment.
52
About Studuino Block Programming Environment
Shows the version of the software you are currently using.
5.6. Context Menus
Right-clicking on blocks in the Script Field or the Script
Field itself will bring up a context menu.
Clean Up
Arranges blocks in the Script Field.
Save Picture of Scripts
Saves an image of the blocks in the Script Field as in .gif format.
Add Comment
Adds a comment. Dragging the resulting comment to any block will append the
comment to that block.
Right-clicking on any block aside from the master
block will bring up a context menu.
Duplicate
Duplicates a block or set of blocks.
Delete
Deletes a block or set of blocks.
6. Troubleshooting
The following section covers troubleshooting methods for this software. In the event that the
solutions provided in this manual do not solve your issue or your issue is not covered,
please contact us directly. Please check our website for the most current information
regarding your product.
http://www.artec-kk.co.jp/studuino
6.1. General Troubleshooting
This section covers troubleshooting methods common to both Studuino Programming
Environments.
53
My DC motor or servomotor won't work in Test mode
Motors require power from the battery box to function properly. Insert batteries into the
battery box and connect it to your Studuino unit before turning the power on.
My robot resets unexpectedly
Exhausted batteries can cause your robot to reset unexpectedly. Replace the batteries in
the battery box.
My sensor values are behaving strangely
Every sensor is different, which can cause variations in the values your sensor gives.
54
6.2. Studuino Icon Programming Environment
I get an error when using Transfer
I can't start Test mode
I can't open the Sensor Viewer
Your software may close unexpectedly if the below error occurs.
Title Message
Could not access Studuino Your Studuino could not sync with your PC. Save your
project, close this software, reset your Studuino, and restart
this software.
Save your program, exit the software, and follow the steps below to reset your Studuino.
1.Turn off the power switch on the battery box and
disconnect the USB cable from your Studuino.
2.Wait three seconds.
3.Reconnect your USB cable and turn on the power switch
for the battery box.
4.Press the Reset button on your Studuino. Resetting will
cause a green LED on your Studuino board to blink.
(see picture)
Try starting Test mode after completing the above steps.
Seeing the below message may mean that your Studuino Programming Environment
system files have been corrupted.
Title Message
Corrupt System File Please reinstall the Studuino Programming Environment
The error that causes this message may cause the Studuino Icon Programming
Environment to close without warning. Save your data using the dialog box, uninstall the
software using the steps in 2.3. Uninstalling the Software, and reinstall the Programming
Environment.
Reset button
LED
55
Title Message
Could not access Studuino COM port error
This message appears when no connection can be made between your PC and Studuino.
You will need to restart your PC.
See the Transfer, Test Mode, and Sensor Viewer sections in 4.5. The Main Menu for details
on solving the above problem.
6.3. Studuino Block Programming Environment
I get an error when using Test mode
I get an error when using Transfer
Your software may close unexpectedly if the below error occurs.
Title Message
Could not access Studuino Studuino could not sync with your PC. Save your project,
exit this software, reset Studuino, and restart the software
Save your program, exit the software, and follow the steps below to reset your Studuino.
1.Turn off the power switch on the battery box and
disconnect the USB cable from your Studuino.
2.Wait three seconds.
3.Reconnect your USB cable and turn on the power switch
for the battery box.
4.Press the Reset button on your Studuino. Resetting will
cause a green LED on your Studuino board to blink.
(see picture)
Try starting Test mode after completing the above steps.
Seeing the below message may mean that your Studuino Programming Environment
system files have been corrupted.
Reset button
LED
56
Title Message
System Error Your Programming Environment system file has been
corrupted. Save your project, exit this software, reset
Studuino, and restart this software.
The error that causes this message may cause the Studuino Block Programming
Environment to close without warning. Save your program, uninstall the software using the
steps in 2.3. Uninstalling the Software, and reinstall the Programming Environment.
Title Message
Could not access Studuino COM port error
This message appears when no connection can be made between your PC and Studuino.
You will need to restart your PC.
See the Transfer and Test mode sections in 5.5. The Main Menu for details on solving the
above problem.
I get an error when using Transfer (when compiling a program)
Seeing the below message may mean that your Studuino Programming Environment
system files have been corrupted.
Title Message
Program Cannot be Compiled An error has occurred in the archiving process. Please
reinstall.
An error has occurred in the object copy 1 process. Please
reinstall.
An error has occurred in the object copy 2 process. Please
reinstall.
The error that causes this message may cause the Studuino Icon Programming
Environment to close without warning. Save your program, uninstall the software using the
steps in 2.3. Uninstalling the Software, and reinstall the Programming Environment.
57
I get a program overflow when compiling my program
The size of programs that can be made in the Block Programming Environment are based
on the specifications of your Studuino. You will see this message when the size of your
program exceeds 15 kilobytes.
Title Message
Program Cannot be
Compiled
Your script is too big. Try different methods to reduce the
size of your program.
If you see this message you will need to make your program smaller by using different
blocks or other methods. Keep in mind that the Block Programming Environment is not
intended for the development of large-scale programs. Due to the smaller scale of the
Studuino Programming Environment, you may want to consider using other software such
as the Arduino IDE or Atmel Studio to develop larger programs.