Studuino Icon Programming Environment Guide Ver 0.9.6 4/17/2014 This manual introduces the Studuino Software environment. As the Studuino programming environment develops, these instructions may be edited or revised.
Index 1. Introduction... 1 1.1. Studuino Setup... 1 1.2. Connecting Parts... 1 2. LEDs... 4 2.1. Flashing One LED... 4 2.2. Flashing Four LEDs in Order... 7 2.3. Using Repeats... 10 3. Buzzers... 11 3.1. Using a Buzzer... 11 3.2. Making a Melody... 13 4. Using Conditions and Submenus... 17 4.1. Push-button Switches... 17 4.2. Submenus... 21 4.3. Using Touch Sensors... 24 4.4. Using Light Sensors... 26 4.5. Using Sound Sensors... 31 4.6. Using Reflective Infrared Sensors... 34 4.7. Using Accelerometers... 38 5. Using DC Motors... 42 5.1. Making the DC Motor Move... 42 5.2. Making a Twin-motor Car... 44 5.3. DC Motor Calibration... 47 6. Using Servomotors... 49 6.1. Servomotor Calibration... 49 6.2. Creating a Robotic Arm that Uses Three Servomotors... 53
1. Introduction 1.1. Studuino Setup Before beginning, visit http://www.artec-kk.co.jp/en/studuino and download the document Studuino Programming Environment Setup for reference. 1.2. Connecting Parts 1 Connecting sensors, buzzers, and LEDs Sensor connecting cables are used to link sensors to the Studuino board. The cables attach to sensor/led/buzzer connectors located on the board, as shown below. The three-wire cable is used for every sensor except the accelerometer, which requires a four-wire cable. Gray wires face inside as shown. A4 A5 A6 A7 A0 A1 A2 A3 Gr Bl Bl Sensor/LED/buzzer connectors Sound, light, and reflective infrared sensors can connect to A0 through A7. Touch sensors, LEDs, and buzzers can connect to A0 through A5. Accelerometers should connect to both A4 and A5. Push-button switches A0-A3 cannot be used when using a sensor with connectors A0-A3. 1
2 Connecting a DC Motor Up to two DC motors can be connected using connectors M1 and M2. DC motor cables can only fit into the connector one way. M1 M2 DC motor connector M1 cannot be used at the same time as servomotor connectors D2 and D4. DC motor connector M2 cannot be used at the same time as servomotor connectors D7 and D8. 3 Connecting a Servomotor Up to eight servomotors can be connected to the servomotor connectors. D9 D10 D11 D12 D2 D4 D7 D8 As shown in the picture to the right, the gray cable should be on the right. Bl Bl Gr DC motor connector M1 cannot be used at the same time as servomotor connectors D2 and D4. DC motor connector M2 cannot be used at the same time as servomotor connectors D7 and D8. 2
4 Connecting a Battery Box Connect the battery box cable to the POWER pins. Sensors/LEDs/buzzers/switches can use voltage supplied via USB, but DC motors and servomotors require voltage from the power jack. When USB is disconnected, all devices require voltage from the power jack to operate. POWER 3
2. LEDs 2.1. Flashing One LED Learning targets: Setting ports Placing icons Flashing and turning off an LED Transferring a program 1 Connect an LED to a sensor/led/buzzer connector. Use connector A0 for the LED. LED A0 Gray Black Black Gray wires face inside as shown. 2 Port Settings Select Edit from the menu, then select Port Settings from the pull down menu to open the setting dialog box. Click Click First, uncheck all the boxes. Then check A0 under Sensor/LED/buzzer and select LED from the menu. 4
3 Place an LED icon. Drag & drop an LED icon from the icon palette to the first Operation Icon box in the Program Field. Drag & Drop LED icon Icon Palette Operation icon box Program Field 4 Turn the LED switch on. Click on the LED icon you've just placed. Select ON in the Attribute Field at the bottom. A misplaced icon can be deleted by right-clicking on it and selecting Delete from the context menu. Click Delete Right-click Attribute Field Click Click 5
5 Transfer the program. Connect the Studuino board to the PC via USB cable and click the transfer your program. button to It can take several seconds to transfer a program. This message will disappear after the transfer completes. Click Do not disconnect the USB cable during a transfer! This can cause incomplete data transfers or software crashes. See 6. Troubleshooting in the Studuino Programming Environment Manual if you're having trouble transferring your program. 6 Checking the result After the data finishes transferring, the LED on the board will flash automatically. While the USB cable is connected, power for the LED is supplied by the PC. You can also power your Studuino using the battery box. 6
2.2. Flashing Four LEDs in Order Learning targets: Deleting and inserting icons Wait icons 1 Connect four LEDs to sensor/led/buzzer connectors on the Studuino board. Use connectors A0, A1, A2, and A3 for the LEDs. LED 4 A0 A1 A2 A3 2 Port Settings Choose LED for A0, A1, A2, and A3 under Port Settings. Refer to 2.1. Flashing One LED for how to select Port Settings.. Gray cable faces inside as shown. 3 Place LED icons. Place LED icons in Operation icon boxes 1 through 8 as shown below. Refer to 2.1. Flashing One LED for how to place icons. Drag and drop icons you've placed to copy them. 7
4 Set up the LED icons as shown below. NO Switch Connector 1 ON A0 2 OFF A0 3 ON A1 4 OFF A1 5 ON A2 6 OFF A2 7 ON A3 8 OFF A3 The LEDs will not flash if the program is transferred as is. Processes 1 through 8 are executed almost instantly and the flashes of the LEDs cannot be seen by human eyes. 5 Inserting Wait icons Insert a Wait icon between each LED icon in the. We'll use the Wait icons to make the flash duration longer. To create an empty operation icon space, right-click on an Operation icon and select Add a column from the context menu. Right-click Click 8
Place a Wait icon in the new space and set the duration. Repeat this process to add a Wait icon after each ON LED icon. Duration 6 Transfer the program again. Run it and see whether the LEDs flash in order. This program makes four LEDs flash and turn off in order. To repeat the program, press the RESET button. RESET button 9
2.3. Using Repeats Learning target: Loop functions Use Repeats and the program from the previous section to make the four LEDs flash in order repeatedly. 1 Place a Start Repeat icon in the first Repeat icon box. Drag & Drop Repeat icon boxes 2 Place an End Repeat icon in the last box. A Repeat Settings dialog box appears when an End Repeat icon is placed. The number of repeats determines how many times the LEDs will flash. A misplaced End Repeat icon can be Drag & Drop deleted by right-clicking on it and selecting Delete from the context menu. Right-click 3 Transfer the program and the LEDs will flash according to the number of repeats that were set. Click To clear any program you've created, select Edit from the menu then click on Reset Menu. Port Settings will also be reset. 10
3. Buzzers 3.1. Using a Buzzer Learning target: Buzzer settings 1 Connect a buzzer to a sensor/led/buzzer connector on the Studuino board. Use connector A0 for the buzzer. Buzzer A0 Gray wires face inside as shown. 2 Port Settings Choose Buzzer for A0 under Port Settings. Refer to 2.1. Flashing One LED for how to select Port Settings.. 3 Place a Buzzer icon. Place a Buzzer icon in the first blank Operation icon space as shown below. Refer to 2.1. Flashing One LED for how to place icons. 11
4 Select a note. Set the pitch and length of the note. Click Click Duration 5 Transfer the program and see if the buzzer sounds. Refer to 2.1. Flashing One LED for how to transfer a program. After transferring, this program plays a note once for the duration you set. To repeat the note, press the Reset button. RESET button 12
3.2. Making a Melody Learning targets: Melody icons Test mode Now we're going to create a melody while checking the pitch and duration of each note. 1 Use the same steps as the previous section, using Melody icons instead of a Buzzer icon. Place two Melody icons in a row in the Operation icon boxes. Refer to 2.1. Flashing One LED for how to place icons. 2 Select a note. Choose scales and notes (or rests), then click to add them to the list. Click Click Click Click 13
To delete a programmed note, right-click on the note, then click OK when the dialog box appears. Right-click Click Example: Twinkle, Twinkle, Little Star Each Melody icon can hold up to eight notes. 1 2 14
3 Make sure the USB cable is connected before clicking the Test button. Click This message will disappear after several seconds, the Test button will turn gray and Test mode will start. Test You can use Test mode to hear and adjust your melody in real time. Don't disconnect the USB cable while in Test mode! This can cause the software to crash. 4 Hear the notes you've programmed by clicking on a Melody icon. Click Select a tempo of 90, 120, or 150. 15
5 Click the Test button again to close Test mode and transfer your program. Click here to transfer your program and play the melody. This program plays a set melody once after it s been transferred. To repeat the melody, press the Reset button. RESET button 16
4. Using Conditions and Submenus 4.1. Push-button Switches Learning target: Setting conditions Use the push-button switches on the Studuino board to create a program that plays a melody and makes the LED flash. 1 Connect a buzzer and LED to sensor/led/buzzer connectors on the Studuino board. Connect the LED to A4 and the buzzer to A5. LED A4 Gray Black Black Buzzer A5 Gray wire should face inside as shown. 2 Port Settings Choose LED for A4 and Buzzer for A5 under Port Settings. Tick the boxes A0-A3 under Buttons. Refer to 2.1. Flashing One LED for how to select Port Settings.. 17
18
3 Place two LED icons and a Melody icon. Refer to 2.1. Flashing One LED for how to place icons. 4 Use the steps in 2.1. Flashing One LED and 3.2. Making a Melody to set each icon's attributes. 1. LED ON 2. Melody 3. LED OFF Set as above. 5 Place a Single Condition Icon in the Condition boxes under each icon. Drag & Drop 19
6 Set each condition. Click Select 1. A0 Button1 ON 2. A1 Button2 ON 3. A2 Button3 ON Set as above. Drag from yellow to gray Select to change from ON to OFF and vice versa. 7 Use Repeat icons to make your program loop steps 1 to 3 indefinitely. Refer to 2.3. Using Repeats for how to use Repeat icons. Select Repeat indefinitely in the Repeat Settings dialog. 8 Transfer the program and check to see if it works. Press A1 to play the melody. Press A0 to turn the LED on. Press A2 to turn the LED off. 20
4.2. Submenus Learning target: Submenus Use Submenus and push-button switches to create a program that makes the LED blink while a melody plays. 1 Use the program from the previous section and add Submenu and Condition icons. Drag & Drop Drag & Drop Set A3 Button4 ON 2 Move the End Repeat icon to the fourth space. Refer to 2.3. Using Repeats for how to use Repeat icons. Select Repeat indefinitely in the Repeat Settings dialog. 21
3 Click the Submenu 1 tab to show the Submenu. Click 4 As shown below, place and set icons in the Operation icon boxes. 1: LED 2: Buzzer 3: Wait 4: LED 5: Buzzer 6: Wait 22
5 Transfer the program and check to see if it works. Hold down A3 and a melody will play in time with the blinking LED. Dual-condition Icons Placing a Dual-condition icon allows you to set two conditions for a sensor. AND: When both conditions are satisfied, the action will be executed. OR: When either of the two conditions is satisfied, the action will be executed. 23
4.3. Using Touch Sensors Learning target: Touch sensors Now we re going to make a program that causes the LED to flash when the touch sensor is pressed. 1 Connect an LED and touch sensor to sensor/led/buzzer connectors on the Studuino board. Use A4 for the LED and A5 for the touch sensor. LED A4 Gray Black Black Touch Sensor 2 Port Settings A5 Gray cables should face inside as shown. Choose LED for A4 and Touch sensor for A5 under Port Settings. Refer to 2.1. Flashing One LED for how to select Port Settings. 3 Place LED icons in the Operation boxes and Condition icons in the Condition boxes. Set them as shown below. 24
4 Use Repeat icons to loop steps 1-2. Refer to 2.3. Using Repeats for how to use Repeat icons. Select Repeat indefinitely in the Repeat Settings dialog. 5 Transfer the program and check to see if it works. The LED will keep flashing while the touch sensor is pressed. 25
4.4. Using Light Sensors Learning targets: Light sensors Sensor Viewer Use a light sensor to create a program that makes the LED flash in a dark environment. 1 Connect an LED and a light sensor to the Studuino board. Connect the LED to A4 and the light sensor to A5. LED A4 Gray Black Black Light Sensor A5 Gray cables should face inside as shown. 2 Port Settings Choose LED for A4 and Light sensor for A5 under Port Settings. Refer to 2.1. Flashing One LED for how to select Port Settings.. 26
3 Use the Sensor Viewer to check the sensor values. Choose Run from the menu, then Sensor Viewer. The Sensor Viewer will appear. Make sure the Studuino board is properly connected to the PC via USB cable. Click It will take several seconds to open the Sensor Viewer. Click Sensor Viewer See whether the sensor value changes as the brightness of the light is varied. Ex: Under a fluorescent light. Shaded by a hand. Light sensor value 27
4 After checking the sensor value, exit the sensor viewer. 1 Left click 5 Place an LED icon in the operation area and a single-condition icon in the condition area. Set them as shown below. 28
6 Specify the range of the light sensor. Range Setting Description (for a set value) = Same value < Less than the value > Greater than the value Within range specified Outside range specified In the example below, the condition is satisfied when the sensor value falls below 3. 7 Add a condition that turns the LED off when more light is present. 29
8 Use Repeat icons to loop steps 1-2. Refer to 2.3. Using Repeats for how to use Repeat icons. Select Repeat indefinitely in the Repeat Settings dialog. 9 Transfer the program and check to see if it works. Under a fluorescent light. Shaded by a hand. If the program does not work properly, change the condition settings. 30
4.5. Using Sound Sensors Learning target: Sound sensors Make a program that changes the number of flashing LEDs in response to the volume of a sound. 1 Connect four LEDs and a sound sensor to the Studuino board. Connect LEDs to A0-A3 and the sound sensor to A4. 灰黒黒 LED 4 A0 A1 A2 A3 Make sure cables are inserted correctly. Sound sensor A4 2 Port Settings Choose LED for A0-A3 and Sound sensor for A4 under Port Settings. Refer to 2.1. Flashing One LED for how to select Port Settings. 31
3 Open the Sensor Viewer to see the sound sensor value. Refer to 4.4. Using Light Sensors for more information. Notice how the sensor value changes as the volume of the sound varies. Ex. When it's quiet When the sensor detects sound Sound sensor value 4 As shown below, place LED and Condition icons in their corresponding spaces. After placing the icons, set their attributes. 1 5 2 6 3 7 4 8 32
5 Use Repeat icons to loop steps 1-8. Refer to 2.3. Using Repeats for how to use Repeat icons. Select Repeat indefinitely in the Repeat Settings dialog. 6 Transfer the program and check to see if it works. The number of LED flashes will vary, depending on the loudness of the sound detected by the sensor. Softer Louder 33
4.6. Using Reflective Infrared Sensors Learning target: Reflective infrared sensors Create a program that uses the reflective infrared sensor to change the note the buzzer plays. 1 Connect a buzzer and a reflective infrared sensor to sensor/led/buzzer connectors on the Studuino board. Connect the buzzer to A0 and the reflective infrared sensor to A1. Buzzer A0 A1 Reflective infrared sensor Make sure cables are inserted correctly. 2 Port Settings Choose Buzzer for A0 and Reflective infrared sensor for A1 under Port Settings. Refer to 2.1. Flashing One LED for how to select Port Settings.. 34
3 Open the Sensor Viewer to see the reflective infrared sensor value. Refer to 4.4. Using Light Sensors for more information. Notice how the sensor value changes as the distance between the object and the reflective infrared sensor varies. Ex. Object is far from the sensor Object is near the sensor 赤外線フォトリフレクタ 赤外線フォトリフレクタ Reflective infrared sensor value What is a reflective infrared sensor? A reflective infrared sensor works by emitting invisible infrared rays. After hitting an object, the rays are reflected back toward the source. The sensor detects the intensity of the reflected rays. More reflective colors, such as white, cause the sensor value to increase more easily. However, when an object is too close, the value gets smaller. (The sensor will reach its maximum value when placed approximately 6 mm away from an object.) 35
4 As shown below, place buzzer and Condition icons in their corresponding spaces. After placing the icons, set their attributes. 1 2 3 4 5 6 7 8 36
5 Use Repeat icons to loop steps 1-8. Refer to 2.3. Using Repeats for how to use Repeat icons. Select Repeat indefinitely in the Repeat Settings dialog. 6 Transfer the program and check to see if it works. Buzzer Block is farther Lower note Block is closer Higher note Reflective infrared sensor 37
4.7. Using Accelerometers Learning target: Accelerometers Make a program that uses the accelerometer to report the degree of tilt using light and sound. 1 Connect three LEDs, the sound sensor, and the accelerometer to the sensor/led/buzzer connectors on the Studuino board. Connect LEDs to A0-A2, the buzzer to A3, and the accelerometer to A4-A5. LED 3 A0 A1 A2 Buzzer A3 Make sure cables are inserted correctly. The accelerometer requires connectors A4 and A5 because it has four wires. Accelerometer A4-A5 2 Port Settings Choose LED for A0-A2, Buzzer for A3, and Accelerometer for A4-A5 under Port Settings. Refer to 2.1. Flashing One LED for how to select Port Settings.. 38
3 Open the Sensor Viewer to see the accelerometer value. Refer to 4.4. Using Light Sensors for more information. As the accelerometer is moved in different angles, each value changes as shown below. What is an accelerometer? An accelerometer works by detecting acceleration in the X, Y and Z axes. It calculates how speed varies over different periods of time. Z X Y An accelerometer, even when in a fixed position, will never show a value of 0 because it detects gravitational acceleration*. Objects are pulled toward the ground by Earth's gravity. This force can be used to measure angles (tilt) relative to the ground. Gravitational acceleration is the force exerted on an object by gravity. 39
4 As shown below, place icons in their corresponding spaces. After placing the icons, set their attributes. 1 2 3 See below for Submenu 1. See below for Submenu 2. 4 5 6 1 2 3 1 2 3 40
5 Use Repeat icons to loop steps 1-6. Refer to 2.3. Using Repeats for how to use Repeat icons. Select Repeat indefinitely in the Repeat Settings dialog. 6 Transfer the program and check to see if it works. Assemble the LED, buzzer, and accelerometer blocks as shown below. Example LED A0 LED A1 LED A2 Accelerometer Connect this way. Buzzer The left-hand LED will blink when level. Middle LED blinks and buzzer sounds when tilted to the right. Right-hand LED blinks and buzzer sounds when tilted to further. 41
5. Using DC Motors 5.1. Making the DC Motor Move Learning target: DC motor settings 1 Connect the DC motor to the DC motor connector on the Studuino board. Use connector M1 for the DC motor. DC motor M1 2 Port Settings Check DC motor box M1. Refer to 2.1. Flashing One LED for how to select Port Settings.. 3 As shown below, place DC motor icons in the Operation icon boxes. Drag & Drop 42
4 DC motor settings Use Test mode to see how the DC motor actually moves while inputting the settings. Refer to 3.2. Making a Melody for more information about Test mode. When checking the DC motor, connect the battery box to the Studuino board and turn on the switch. The USB cable does not supply enough power to operate the DC motors. 43
5.2. Making a Twin-motor Car Learning target: Motion icons 1 Assemble the car as shown below. (1) Attach wheels to the DC motors. Make a symmetrical pair. (2) Attach both DC motors to the bottom of the Studuino mount. (3) Use blocks to make a rear wheel. (4) Connect the DC motors and battery box to the Studuino board. M1: Right DC motor M2: Left DC motor POWER: Battery box (5) Secure the battery box to the Studuino mount. Complete 44
2 Port Settings Check DC motor boxes M1 and M2. Refer to 2.1. Flashing One LED for how to select Port Settings. 3 Use Test mode to see how the DC motor actually moves while inputting the settings. Refer to 3.2. Making a Melody for more information about Test mode. When checking the DC motor, connect the battery box to the Studuino board and turn on the switch. The USB cable does not supply enough power to operate the DC motors. Motion icons Forward Both (right and left) motors rotate forward Left turn (F) Only the right motor rotates forward Right turn (F) Only the left motor rotates forward Rotate The right and left motors turn in opposite directions. Backward Both (right and left) motors rotate in reverse Left turn (B) Only the right motor rotates in reverse Right turn (B) Only the left motor rotates in reverse 45
4 Select and place Motion icons to create a program that makes your car reach a goal. Example: A program that makes the car travel to three specified locations in order. Programming tips Before transferring the program, use Test mode to verify the proper time, speed, distance, and rotation angle for each Motion icon. Example 5 Transfer the program if your car moves as planned. Pressing the Reset button will make the program start over from the beginning. RESET button Your car may run differently depending on the type of floor and the strength of your batteries. 46
5.3. DC Motor Calibration Learning target: DC motor settings Every DC motor is different and each one may rotate at different speeds. If you make a car using two DC motors and it veers to the left or right when moving forward, you can fix this issue by calibrating your DC motors. Connect your DC motors to the Studuino. 1Connect your DC motors to the Studuino. 2Port Settings Tick the box next to DC motor connectors M1 and M2 under Port Settings. Refer to 2.1. Flashing One LED for how to select Port Settings. 3Select Edit from the menu, then select Motor Calibration from the pull down menu to open the setting dialog box. Make sure the Studuino board is properly connected to the PC via USB cable. Click Click 47
Click on Motor Calibration and you will see the dialog box below. The bottom half of the window is used to calibrate your DC motors. 4 Click on the Rotate button and your motors will rotate. Your motors will rotate at maximum speed. Click 5 Use the sliders to adjust the speed of your motors. Use the slider to adjust the faster motor until both motors are rotating at the same speed. Adjust speed using the slider Click Slow Fast 6 Click OK to close the dialog box. Click OK to apply settings. Click 48
6. Using Servomotors 6.1. Servomotor Calibration Learning target: Servomotor calibration Due to individual differences in each servomotor, there may be several degrees of deviation in their angles. This deviation needs to be adjusted through calibration. 1 Adjusting the drive shaft angle of the servomotor Before connecting the servomotor, check to see if the drive shaft is attached correctly. From the default position, turn the block part of the drive shaft right and left. If there is a large difference in how much each side turns, this means the block is slipping and needs to be adjusted. Cable Drive shaft Aligned Body Default Misaligned To prevent the inner gears from getting damaged, the block part is made to turn freely when a large force is applied to the drive shaft. Turn the block part by hand in the opposite direction until the drive shaft clicks into the proper position. Do not turn the drive shaft block unless absolutely necessary. This can damage the servomotor. If the deviation is nominal, use the calibration settings in the software. 49
2 Connect the servomotor to the servomotor connector on the Studuino board. Use connector D9 for the servomotor Connect the battery box. 灰黒黒 Make sure cables are inserted correctly. 3 Port Settings Check Servomotor box D9. Refer to 2.1. Flashing One LED for how to select Port Settings. 4 As shown below, place DC motor icons in the operation area. Drag & Drop 50
5 Select Edit from the menu, then select Motor Calibration from the pull down menu to open the setting dialog box. Make sure the Studuino board is properly connected to the PC via USB cable. Click Click When Motor Calibration is selected, all connected servomotors are set to 90 degrees. At this time, the Test mode window shown below will appear. Connect the battery box to the board and turn on the power. The drive shaft and body are at a 90 degree angle. 51
6 If the block portion isn't properly aligned, try inputting values in the Motor Calibration menu until you find a suitable angle. Adjustment needed If using a different servomotor for a connector, be sure to re-calibrate the servomotor. After calibration, we recommend putting a sticker on the connector used for the servomotor so it can be easily identified. 52
6.2. Creating a Robotic Arm that Uses Three Servomotors Learning target: Servomotors 1 Calibrate three servomotors, following the steps in the previous section. Use connectors D9, D10, and D11 for the servomotors. 2 Assemble the robotic arm as show below. Part 1 D9 Complete Part 2 D10 Assemble the same as Part 1. Complete Part 3 D11 Complete 53
Assembling the Arm (1) Assemble part 1-3 as shown. Part 2 Part 3 Part 1 (2) Mount the battery box on the mount as shown, and connect the cable to the POWER pins. POWER (3) Attach the arm as shown and connect each servomotor to the board. D9 D10 D11 黒黒灰 Make sure cables are inserted correctly. 54
3 Port Settings In the Port Settings dialog box, tick boxes D9, D10, and D11 in the servomotor area. Also, tick boxes A0 through A3 in the Button area. Refer to 2.1. Flashing One LED for how to select Port Settings.. 4 Place icons and complete setting as shown below. Select Repeat indefinitely in the Repeat Settings dialog. 1 2 3 4 5 6 7 55
Transfer the program and check to see if it works. A1: Arm bends downward A3: Arm bends to the left A0: Arm bends to the right A2: Arm opens 56