Studuino Tutorial Block 1
Studuino Tutorial Block 1
Studuino Tutorial Block 1
Date Content
2016/11/01 First version
2017/01/16 Updated for new Studuino website
2017/04/14 Changed access guide based on new Studuino website
2018/01/22 Revised to include software and OS updates
2018/06/28 Updated description of Buzzer values
1
Index
1. Getting Started........................................................................................... 1
2. Setup........................................................................................................... 1
2.1. Installing Studuino Software.............................................................. 1
2.2. Connecting Parts............................................................................... 2
3. LEDs............................................................................................................ 5
3.1. Connecting an LED............................................................................ 5
3.2. Port Settings...................................................................................... 5
3.3. Lighting Up an LED............................................................................ 7
3.4. Making an LED Blink.......................................................................... 9
3.5. Setting a Specific Number of Blinks................................................. 11
3.6. Changing the Speed of a Blink......................................................... 14
4. Buzzers...................................................................................................... 16
4.1. Connecting a Buzzer........................................................................ 16
4.2. Port Settings.................................................................................... 16
4.3. Playing a Buzzer.............................................................................. 17
4.4. Playing a Melody.............................................................................. 19
4.5. Using a List to Play Melodies........................................................... 22
5. Push-buttons and Sensors...................................................................... 31
5.1. Connecting an LED.......................................................................... 31
5.2. Push-buttons.................................................................................... 31
5.2.1. Port Settings....................................................................................................32
5.2.3. Programming................................................................................................. 34
5.3.4. Programming..................................................................................................41
5.4. IR Photoreflectors............................................................................ 45
5.4.1. Connecting an IR Photoreflector.....................................................................45
5.4.4. Programming..................................................................................................47
1
5.5.1. Connecting a Touch Sensor............................................................................52
5.5.4. Programming..................................................................................................53
5.6.4. Programming.................................................................................................57
2
1. Getting Started
This manual explains how to use the following electronic parts in the Block Programming
Environment:
LEDs
Buzzers
Push-buttons
Light Sensors
IR Photoreflectors
Touch Sensors
Sound Sensors
2. Setup
2.1. Installing Studuino Software
Follow the steps below to download the instruction manuals
you’ll need to install your Studuino software.
1
2.2. Connecting Parts
① Connecting Sensors, LEDs, and Buzzers
The pictures below show how to plug sensor connecting cables into your Sensors, Buzzers, and
LEDs in order to connect them to your Studuino.
★ Every sensor uses a three-wire cable except for the Accelerometer, which uses a four-wire cable.
A0 A1 A2 A3
A4 A5 A6 A7
Gray
Black
Black
Sensor/LED/Buzzer Connectors
2
② Connecting DC Motors
Up to two DC Motors can be connected using connectors M1 and M2.
★ DC Motor connectors can only connect one way.
M1
M2
③ Connecting Servomotors
Up to eight Servomotors can be connected to the Servomotor connectors.
D9
D10
D11
D12
D2
D4
D7
D8
Black
Black
Gray
★ DC Motor connector M1 can't be used at the same time as Servomotor connectors D2 and D4.
★ DC Motor connector M2 can't be used at the same time as Servomotor connectors D7 and D8.
3
④ Connecting a Battery Box
Plug your Battery Box into the POWER connector.
Sensors, LEDs, Buzzers, and Push-buttons can run on a USB connection, but DC Motors and
Servomotors require power from the Battery Box. You’ll also need a Battery Box in order to
power devices when the USB cable is disconnected.
POWER
4
3. LEDs
Learn how to program an LED in this chapter. It covers connecting devices to your Studuino,
setting ports, programming in the Block Programming Environment, and transferring data to
the board.
3.1. Connecting an LED
Connect an LED to Sensor/LED/Buzzer connector A4 on your Studuino.
Gray
Black
A4 Black
LED
① Click
② Click
5
Check A4 under Sensor/LED/Buzzer and choose LED.
② Click
③ Choose LED
④ Click OK
You’ve now set the Studuino ports you’ll be using in the Block Programming Environment.
6
3.3. Lighting Up an LED
It’s time to start learning about some programming basics using the block.
① Click the Motion button in the Command Palette. Now drag to the Script
① Click
Command Palette
Script Field
Block Palette
★ Move blocks anywhere in the Script Field by dragging and dropping them. Dragging and
dropping a block will also move any blocks connected to it.
7
② Use a USB cable to connect your Studuino to your PC. Now choose Transfer from the
Run menu to transfer your program.
① Click
② Click
Seeing the message below disappear means that your program has been successfully
transferred to your Studuino. The LED will light up automatically once the transfer finishes.
Your program didn’t transfer correctly if you see any of the messages below. Check the solutions
and try again.
Message Solution
Could not access to Studuino Make sure your USB cable is properly connected
Make sure Studuino is connected to the to your PC and Studuino
PC.
8
3.4. Making an LED Blink
Now we’re going to program your LED to blink based on the program from 3.3. Lighting Up
an LED. This section will teach you about repeats by using the block to make your
program repeat forever.
① Click Control in the Command Palette then drag from the Control Palette to
the Script Field. Connect it to the blocks of your last LED program.
① Click
① Right-click
② Choose Duplicate
Connect it to the
end of your
program
9
④ Drag from the Control Palette and use it to enclose your program in the
Script Field.
① Click ▼
② Choose off
Use a USB cable to connect your Studuino to your PC. Now choose Transfer from the Run
menu to transfer your program. The LED will blink once every second once the transfer finishes.
10
3.5. Setting a Specific Number of Blinks
Now we’re going to control the number of times your LED blinks based on the program from 3.4.
Making an LED Blink. This section will teach you how to set the number of repeats by using the
block.
② Move the blocks in the block into the opening of the block.
11
③ Drag the block back to the Block Palette to delete it.
Except for , any block can be deleted by dragging it back to the Block Palette.
★ Right-click a block to bring up the context menu and click Delete to delete it.
★ Select Undelete from the Menu bar to restore a block if you've accidentally deleted it.
Repeat 10 times
① Turn on LED
② Wait one second
③ Turn off LED
④ Wait one second
Use a USB cable to connect your Studuino to your PC. Now choose Transfer from the Run
menu to transfer your program. The LED will blink 10 times in 1-second intervals once the
transfer finishes.
12
Next, we’ll change the number of blinks by changing the number in the block.
⑤ Click the 10 in the block and type in the number of LED blinks you want.
Use a USB cable to connect your Studuino to your PC. Now choose Transfer from the Run
menu to transfer your program. Once the transfer finishes, the LED will automatically blink the
number of times you set.
You can start a transferred program by choosing Run from the Run menu.
① Click
② Click
★ Once you’ve transferred a program, you can run it using power from your Battery Box. Unplug your USB
cable from the Studuino. Now plug in your Battery Box, turn it on, and check to see if your LED blinks the
number of times that you set.
★ Once your program finishes, restart it by pressing the RESET button on the board.
Battery Box
RESET Button
POWER
13
3.6. Changing the Speed of a Blink
Now we’re going to control how fast your LED blinks based on the program from 3.5. Setting a Number of
Blinks. While you can change the speed of an LED by changing the value in the block, let’s
try using a variable to change multiple values at once.
① Open the Command Palette and click the Variables button. Now click Make a variable. You’ll be
asked for a variable name. Name your variable time and click OK.
① Click
② Click
③ Name it "time"
④ Click here
② You’ll now see blocks that let you control the time variable
14
③ Connect the block to the block. Now set the value in the
block to 0.5.
① Drag
and Drop ② Click here and type
Drag
and Drop
Now you’ve programmed your LED to blink ten times in 0.5-second intervals.
Repeat 10 times
② Turn on LED
LED
③ Wait for time (0.5 seconds)
Use a USB cable to connect your Studuino to your PC. Now choose Transfer from the Run menu to
transfer your program. The LED will blink 10 times in 0.5-second intervals once the transfer finishes.
15
4. Buzzers
This section teaches how to program a Buzzer to play and stop as well as how to use list and function
blocks.
4.1. Connecting a Buzzer
Connect your Buzzer to Sensor/LED/Buzzer connector A5 on the Studuino.
Gray
Gray
Black
Black
Black
Black
Buzzer A5
Choose Buzzer
16
4.3. Playing a Buzzer
Now we're going to make a program that makes the Buzzer play for one second. This section teaches you
② Click ▼ in the block to show the keyboard. Hover your mouse over
any key on the keyboard to see the note. Now click E (64) to select it.
① Click
② Click
17
★ Notes in the programming software are shown as numbers. These numbers follow the MIDI standard,
which allows performance data for musical instruments to be transferred between devices. The note
equivalent for each number is shown below.
Now you’ve programmed your Buzzer to play the note E (64), or Mi, for one second.
Use a USB cable to connect your Studuino to your PC. Now choose Transfer from the Run menu to
transfer your program.
18
4.4. Playing a Melody
Now it’s time to program your Buzzer to play the notes C, C, G, G, A, A, and G, the melody for Twinkle,
Twinkle, Little Star. The Buzzer can do this by playing several notes in a row.
① You’ll need to add a block to the program you created in 4.3. Playing a Buzzer.
③ Right click the block to duplicate it. Now connect the new blocks to the
original ones.
① Right click
② Choose Duplicate
19
④ Repeat step ③ to make seven groups of repeat blocks. Delete the last block
and drag any extra blocks back to the Command Palette to delete them.
20
⑤ Set the blocks to C (60), C (60), G (67), G (67), A (69), A (69), and G
(67).
Now you’ve programmed your Buzzer to play the melody for Twinkle, Twinkle, Little Star.
Use a USB cable to connect your Studuino to your PC. Now choose Transfer from the Run menu to
transfer your program. Your Buzzer will play Twinkle, Twinkle, Little Star once the program transfers.
21
4.5. Using a List to Play Melodies
The program you made in 4.4. Playing a Melody can be simplified by using a list.
●Making a List
① Click the Make a list button in the Variables Palette. Now name it list_note.
① Click
② Click
③ Name it "list_note"
② You’ll see two things: an empty list and a group of blocks that control it.
22
Now we'll learn how each block controls a list.
③ Drag three blocks to the Script Field. Now set them to 0, 12, and 15.
④ Click and the blocks connected to will be run in order. This will add the
values 0, 12, and 15 to the list.
Click
The program will
be run in order
23
⑥ Click .
Click
⑧ Click .
Click
24
⑨ Delete the block. Now drag to the
Script Field, connect it to your program, and set it to delete the number at row 2.
⑩ Click .
Click
You can use the steps listed above to modify (add, insert, replace, or delete) values in a list. You can also
access the information in the list with the following blocks:
Next, we'll use a list to recreate the program from 4.4. Playing a Melody.
25
● Playing a Melody Using a List
Use the blocks shown below with your program from 4.4. Playing a Melody to create a list of
notes and play it seven times. We can simplify this program by using a list to set the notes of the
blocks.
⑪ Delete the block. Now click the x on the right to delete all of the
items in the list.
26
⑬ Enter the values shown below into the blocks.
⑭ Drag from the Control Palette and connect it to the top of the blocks you made
in ⑬ . Now click on the ▼ in the block and choose new.... Name the function init_code.
① Click
② Select
④ Click
And now you’ve made a function that will store the melody for Twinkle, Twinkle, Little Star to a list. Any
blocks connected to the block will run when the block runs. This program
will make run when runs, storing the codes to the list.
27
⑮ Drag from the Control Palette and connect it to . Now click ▼ to
choose the init_code function.
Choose “init_
Drag and drop code”
⑰ Drag two from the Control Palette and set them to 0.3 and 0.1.
28
⑱ Drag from the Variables Palette and connect it to
⑲ Click the Make a variable button in the Variables Palette. Name the variable number.
① Click
③ Click
⑳ Drag and connect your new variable blocks to the places shown below.
Set the value of to 1.
29
㉑ Drag from the Control Palette and connect it to the other blocks. Set it to 7.
The program you just completed uses a list to play the beginning of Twinkle, Twinkle, Little Star. Look below
to see how your program works:
The value of number increases by one every time the program repeats, so the number variable can play
each note registered to the list in order.
Use a USB cable to connect your Studuino to your PC. Now choose Transfer from the Run menu to transfer
your program. The Buzzer will play Twinkle, Twinkle, Little Star once the program transfers.
30
5. Push-buttons and Sensors
In this section you’ll learn how to program and use Push-buttons, sensors, and LEDs.
LED A4
Gray
Black
Black
5.2. Push-buttons
You can find the Push-buttons right on your Studuino. They’re assigned to connectors A0-A3.
A1
A3 A0
A2
31
5.2.1. Port Settings
Before programming, you'll need to set the ports in the Block Programming Environment to match the parts
connected to your Studuino.
Select Edit from the menu and choose Port Settings to open the Port Settings dialog box. Make sure that
boxes A0-A3 are checked under Button and that you’ve selected LED for Sensor/LED/Buzzer connector
A4 (and check the box if it isn’t checked already).
① Click
② Click
32
Seeing the messages below means that Test Mode has failed to start. Check the solutions and try again.
Message Solution
Could not access to Studuino Make sure your USB cable is properly
Make sure Studuino is connected to the PC. connected to your PC and Studuino.
Pressing the RESET button on the Studuino board while in Test Mode will cause the connection between
your Studuino and PC to be interrupted and the message below to appear.
Message Solution
Could not acces to Studuino While you can continue programming once
Communication terminated. Close Test mode, you’ve closed Test Mode, we recommend
reconnect your Studuino to your PC, reset your following the message and restarting the
Studuino and restart Test mode. software due to the resulting unstable
connection.
Push-buttons send a value of 1 when released and a value of 0 when you press them.
Try pressing buttons A0-A3 on your Studuino and see how the values respond in the Sensor Board.
Once you’re finished, choose Test OFF from the Run menu to close Test Mode.
33
5.2.3. Programming
In this section we'll be programming your LED to blink when you press a button. We’ll also be learning how
② Drag from the Control Palette and connect it to the bottom of your program.
34
④ Set the new block to OFF.
⑥ Drag from the Control Palette to the Script Field. Fit the blocks from ④ into the
opening of .
35
⑦ Set the number of repeats to 2.
36
⑩ Drag from the Sensing Palette and drop it into the left side of the
block. Set the right side to 0.
The block you just made will make your LED blink twice when you press the Push-button and change its
value to 0.
37
⑫ Drag from the Control Palette to the Script Field. Move the blocks from ⑪ into the
Now you’ve programmed your LED to blink two times when you press button A0.
Repeat forever
If you press the button
blink LED two times
38
Use a USB cable to connect your Studuino to your PC. Now choose Transfer from the Run menu to transfer
your program.
① Click
② Click
Seeing the message below disappear means that your program has been successfully transferred to your
Studuino. Once the transfer finishes, press A0 and your LED will blink two times.
Your program didn’t transfer correctly if you see any of the messages below. Check the solutions and try
again.
Message Solution
Could not access to Studuino Make sure your USB cable is properly
Make sure Studuino is connected to your PC and Studuino.
connected to the PC.
39
5.3. Light Sensors
You can use a Light Sensor to measure the amount of light in the area.
A4
LED
Gray
Black
Black
Before programming, you'll need to set the ports in the Block Programming Environment to match the parts
connected to your Studuino. Select Edit from the menu and choose Port Settings to open the Port Settings
dialog box. Check A6 under Sensor/LED/Buzzer and choose Light Sensor. You’ll also need to check A4
and choose LED.
40
5.3.3. How a Light Sensor Works
Let’s take a look at your Light Sensor’s values. Use a USB cable to connect your Studuino to your PC. Now
choose Test ON from the Run menu. Start Test Mode and you’ll see the Sensor Board displaying [A6] Light
Sensor.
The Light Sensor has a range of 0-100, with 0 being complete darkness and 100 being bright light. Now try
covering the Light Sensor with your hand while you look at the Sensor Board to see how the values change.
Once you’re finished, choose Test OFF from the Run menu to close Test Mode.
5.3.4. Programming
Now we’re going to program your LED to turn on as the Light Sensor detects darkness.
41
② Drag from the Operators Palette and insert it into the block.
③ Drag from the Sensing Palette and drop it into the left side of the block.
Set the right side to 50.
Since your Light Sensor values respond to the amount of light in the room, look at the Sensor Board
to decide which value to put into the right side.
42
The block you just made will light up the LED when then room is dark (Light Sensor value is less than 50)
and turn it off when the room is bright (Light Sensor value is greater than 50).
⑤ Drag to the Script Field. Move the blocks from ④ into the opening of the
block.
43
Now you’ve programmed your LED to light up in darkness and turn off in light.
Repeat forever
If dark
Turn on LED
If light
Turn off LED
⑦ Now let’s test if changing the amount of light your sensor recieves turns your LED on and off. Make
sure your Studuino is connected to your PC. Now choose Test ON from the Run menu.
Click
The blocks currently running will have a white outline. Take a look at the Sensor Board as you cover the
Light Sensor with your hand and see how the values change.
Choose Transfer from the Run menu to transfer your program to your Studuino. Now you can unplug your
USB cable and run your program using the Battery Box.
44
5.4. IR Photoreflectors
The IR Photoreflector uses reflected infrared light to measure its distance from an object.
Connect an LED to Sensor/LED/Buzzer connector A4 on your Studuino and your IR Photoreflector to A7.
LED
A4
Gray
Black
Black
Before programming, you'll need to set the ports in the Block Programming Environment to match the parts
connected to your Studuino. Select Edit from the menu and choose Port Settings to open the Port Settings
dialog box. Check A7 under Sensor/LED/Buzzer and choose IR Photoreflector. You’ll also need to check
A4 and choose LED.
45
5.4.3. How an IR Photoreflector Works
Let’s take a look at your IR Photoreflector’s values. Use a USB cable to connect your Studuino to your PC.
Now choose Test ON from the Run menu. Start Test Mode and you’ll see the Sensor Board displaying [A7]
IR Photoreflector.
Your IR Photoreflector measures 100 degrees of reflected infrared light, with the values increasing towards
100 as an object becomes closer. The values will be at their maximum when 6-10 mm away from an object
and will decrease again as you move it closer to the object.
The color and texture of an object will also have an effect on the sensor’s values. (A white object will give
you higher values than a black one when placed close to the sensor.)
Move the object and check if the value indicated on the Sensor Board changes according to the distance
between the sensor and the object.
Once you’re finished, choose Test OFF from the Run menu to close Test Mode.
46
5.4.4. Programming
In this section we'll be programming your LED to blink when an object is close to the IR Photoreflector. We’ll
② Drag from the Control Palette and connect it to the bottom of your program.
① Right click
② Select Duplicate
47
④ Set the new block to OFF.
48
⑦ Drag from the Operators Palette into the block.
⑧ Drag from the Sensing Palette and drop it into the left side of
the block. Set the right side to 15. Now move the blocks from ⑤ into the opening of the
block.
The block you just made will blink your LED when an object becomes closer (the IR Photoreflector’s value is
over 15).
49
⑨ To make your program start with your LED off, drag from the Motion Palette and
If an object is close
Blink LED one time
50
⑪ Now let’s check to see if your LED blinks. Make sure your Studuino is connected to your PC. Now
choose Test ON from the Run menu.
⑫ Once you’ve opened Test Mode, click .
Click
Now look at the Sensor Board as you bring the object closer and check that the LED blinks when the value
goes over 15.
Choose Transfer from the Run menu to transfer your program to your Studuino. Now you can unplug your
USB cable and run your program using the Battery Box.
51
5.5. Touch Sensors
A Touch Sensor is a kind of switch that detects whether or not you press it. You can use one to detect things
like collision with objects.
5.5.1. Connecting a Touch Sensor
Connect an LED to Sensor/LED/Buzzer connector A4 on your Studuino and your Touch Sensor to A2.
LED A4
Gray
Black
Black
Touch Sensor
① Uncheck
52
5.5.3. How a Touch Sensor Works
Let’s take a look at your Touch Sensor’s values. Use a USB cable to connect your Studuino to your PC.
Now choose Test ON from the Run menu. Start Test Mode and you’ll see the Sensor Board displaying [A2]
Touch Sensor.
Touch Sensors send a value of 1 when released and a value of 0 when you press them. Now try pressing
your Touch Sensor while looking at the Sensor Board to see how the values change.
Once you’re finished, choose Test OFF from the Run menu to close Test Mode.
5.5.4. Programming
Now we’re going to program your LED to turn on when you press the Touch Sensor. We’ll also be learning
how to use the block.
① Drag from the Motion Palette and connect it to the block, then
set it to off.
53
② Drag from the Control Palette and connect it to .
54
④ Drag from the Sensing Palette and drop it into the left side of the
block. Set the right side to 0.
⑤ Drag from the Motion Palette and connect it to the other blocks.
Now you’ve programmed your LED to light up when you press the Touch Sensor.
Make sure your Studuino is connected to your PC. Now choose Transfer from the Run menu. Check that
your LED lights up when you press the Touch Sensor.
55
5.6. Sound Sensors
Sound Sensors are used to measure the volume of a sound.
5.6.1. Connecting a Sound Sensor
Connect an LED to Sensor/LED/Buzzer connector A4 on your Studuino and your Sound Sensor to A3
LED A4
Gray
Black
Black
① Uncheck
56
5.6.3. How a Sound Sensor Works
Let’s take a look at your Sound Sensor’s values. Use a USB cable to connect your Studuino to your PC.
Now choose Test ON from the Run menu. Start Test Mode and you’ll see the Sensor Board displaying [A3]
Sound Sensor.
Your Sound Sensor has a range of 0-50, starting at 0 for silence and increasing towards 50 as sounds
become louder. Try clapping near the Sound Sensor or blowing directly on it as you look at the Sensor
Board to see how the values change.
Once you’re finished, choose Test OFF from the Run menu to close Test Mode.
5.6.4. Programming
Now let’s program a blinking LED to turn off when you blow on the Sound Sensor. We’ll also be learning how
57
② Drag from the Control Palette and connect it to the other blocks.
① Uncheck
② Select Duplicate
58
⑤ Now connect your duplicated blocks to the original ones.
59
⑦ Drag from the Operators Palette into the block.
⑧ Drag from the Sensing Palette and drop it into the left side of the
block. Set the right side to 30.
60
The block you’ve just made tells a blinking LED to turn off when you blow on the Sound Sensor and the
value goes over 30.
⑪ Drag from the Motion Palette and connect to the block. Now set it to OFF.
61
Now you’ve just programmed a blinking LED to turn off when you blow on the Sound Sensor.
Blink LED
⑫ Now let’s check to see if your LED turns off when you blow on the Sound Sensor. Make sure your
Studuino is connected to your PC. Now choose Test ON from the Run menu.
Click
Now look at the Sensor Board as you blow on the Sound Sensor and check that the LED turns off when the
value goes over 30.
Choose Transfer from the Run menu to transfer your program to your Studuino. Now you can unplug your
USB cable and run your program using the Battery Box.
62