Top Banner
1 Systems of Technology - Robotics: Section 3 Instructions/Build Plans Team Members: 1. ________________________ 3. ________________________ 2. ________________________ 4. ________________________ Introduction Place a check in each box as each step is completed. 1. Locate/Open: The Arduino IDE & Ardublock - Video Tutorial. 2. Assemble: Ellipse Mechanism (Build Plans/Cable Diagram on pages 7-11). The Arduino IDE Place a check in each box as each step is completed. 1. On a computer, Open: Arduino and become familiar with the different components of the program. The Arduino IDE & ArduBlock v2.0 Text Editor Where sketches are written. Upload Compiles code and uploads to the ROKduino. Verify Checks the code for errors in compiling. New Creates a new sketch. Open Presents a menu of all the sketches in a sketchbook. Save Saves the sketch. Serial Monitor Displays data or information being sent from the ROKduino. Text Console Displays complete error messages. Status Bar Displays if code was successfully or unsuccessfully uploaded to ROKduino. Tab Opens or selects new tab. The Arduino IDE is used to write text-based programs that are uploaded to the ROKduino. Programs that are written using the Arduino IDE are referred to as sketches.
12

The Arduino IDE & ArduBlock - rokenbokeducation.org. Locate/Open: The Arduino IDE & Ardublock - Video Tutorial. 2 ... code in the Arduino IDE. ... the speed of the Motor Module Block

May 14, 2018

Download

Documents

dinhcong
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: The Arduino IDE & ArduBlock - rokenbokeducation.org. Locate/Open: The Arduino IDE & Ardublock - Video Tutorial. 2 ... code in the Arduino IDE. ... the speed of the Motor Module Block

1

Systems of Technology - Robotics: Section 3 Instructions/Build Plans

Team Members:

1. ________________________ 3. ________________________

2. ________________________ 4. ________________________

IntroductionPlace a check in each box as each step is completed.

1. Locate/Open: The Arduino IDE & Ardublock - Video Tutorial.

2. Assemble: Ellipse Mechanism (Build Plans/Cable Diagram on pages 7-11).

The Arduino IDEPlace a check in each box as each step is completed.

1. On a computer, Open: Arduino and become familiar with the different components of the program.

The Arduino IDE& ArduBlock

v2.0

Text EditorWhere sketches are written.

UploadCompiles code and uploads to the ROKduino.

VerifyChecks the code for errors in compiling.

NewCreates a new sketch.

OpenPresents a menu of all thesketches in a sketchbook.

SaveSaves the sketch.

Serial MonitorDisplays data or informationbeing sent from the ROKduino.

Text ConsoleDisplays complete error messages.

Status BarDisplays if code was successfullyor unsuccessfully uploaded to ROKduino.

TabOpens or selects new tab.

The Arduino IDE is used to write text-based programs that are uploaded to the ROKduino. Programs that are written using the Arduino IDE are referred to as sketches.

Page 2: The Arduino IDE & ArduBlock - rokenbokeducation.org. Locate/Open: The Arduino IDE & Ardublock - Video Tutorial. 2 ... code in the Arduino IDE. ... the speed of the Motor Module Block

2

ArduBlock Place a check in each box as each step is completed.

1. On the top menu bar, Select: Tools > ArduBlock.

2. Become Familiar: with the different components of ArduBlock.

ContainersContain different “blocks” of code that can be used to create a sketch.

Code BlocksUsed to create sketchesthat can be uploaded tothe ROKduino. Sketch Pad

Where code blocks are usedto create a sketch. Each codeblock used will be converted into a human-readable line of code in the Arduino IDE.

Block Discard Area

NewCreates a new sketch.

Block Discard AreaUsed to discard unwantedblocks from the sketch pad.

Serial MonitorDisplays data or informationbeing sent from the ROKduino.

UploadCompiles code and uploads to the ROKduino.

SaveSaves the sketch.

NewCreates a new sketch.

ArduBlock is a visual programming tool that simplifies writing sketches by using “blocks of code”. After a sketch is created in ArduBlock, it is converted and organized into a human-readable, text-based sketch in the Arduino IDE, and uploaded to the ROKduino.

Page 3: The Arduino IDE & ArduBlock - rokenbokeducation.org. Locate/Open: The Arduino IDE & Ardublock - Video Tutorial. 2 ... code in the Arduino IDE. ... the speed of the Motor Module Block

3

Setup InstructionsPlace a check in each box as each step is completed.

1. Connect: ROKduino to a computer using the USB cable.

2. Power ON: the ROKduino.

3. Click on: the Arduino window.

4. On the top menu bar, Select: Tools > Port > ROKduino.

Creating a SketchPlace a check in each box as each step is completed.

1. Click on: the ArduBlock window.

2. In ArduBlock, observe: the Yellow Program Block.

3. Connect: a Motor Module Block to the loop section of the program block.

4. Observe: the values that can be adjusted on the Motor Module Block.

5. Click: Upload to Arduino.

6. Observe: the Ellipse Mechanism.

The Ellipse Mechanism should be rotating clockwise at full speed. Since the Motor Module Block was connected to the loop function in ArduBlock, the ROKduino will continue to command the motor module to rotate clockwise, at full speed, over and over again.

7. Observe: how the information from the blocks in ArduBlock is converted into a human-readable, text-based sketch (program) in the Arduino IDE.

Arduino IDE ArduBlock

Page 4: The Arduino IDE & ArduBlock - rokenbokeducation.org. Locate/Open: The Arduino IDE & Ardublock - Video Tutorial. 2 ... code in the Arduino IDE. ... the speed of the Motor Module Block

4

Adjust Speed and DirectionPlace a check in each box as each step is completed.

1. Adjust: the speed of the Motor Module Block from 1023 (full speed) to 750.

2. Adjust: the direction of the Motor Module Block from clockwise to counter-clockwise.

3 Click: Upload to Arduino.

4. Observe: the Ellipse Mechanism.

The Ellipse Mechanism should now be rotating counter-clockwise at a reduced speed (750). The speed and direction of the motor module can both be adjusted. Try adjusting the speed and direction of the motor module yourself!

Incorporate the Light ModulePlace a check in each box as each step is completed.

1. In ArduBlock: connect a Light Module Block to the bottom of the Motor Module Block.

2. Observe: the values that can be adjusted on the Light Module Block.

3. Adjust the output # on the block to: 2 (The light module is connected to Output # 2 on the ROKduino).

4. Click: Upload to Arduino.

5. Observe: the Ellipse Mechanism.

The Ellipse Mechanism should be rotating, and the red light on the light module should be illuminated at full brightness. The color and brightness of the light module can both be adjusted. Try adjusting the brightness and color yourself!

Use a DelayPlace a check in each box as each step is completed.

1. In ArduBlock: connect a delay block to the bottom of the Light Module Block.

2. Right Click: on the Motor Module Block and select “clone”.

3. Drag and Connect: the cloned set of blocks to the bottom of the delay block.

4. Adjust the values of the top Motor Module Block to: Output - 1, Speed - 1023, Direction - Clockwise.

5. Adjust: the values of the top Light Module Block to: Output - 2, Brightness - 1023, Color - Red.

Page 5: The Arduino IDE & ArduBlock - rokenbokeducation.org. Locate/Open: The Arduino IDE & Ardublock - Video Tutorial. 2 ... code in the Arduino IDE. ... the speed of the Motor Module Block

5

6. Adjust the value of the top delay Millis block to: 3000.

7. Adjust the values of the bottom Motor Module Block to: Output - 1, Speed - 1023, Direction - Counter-Clockwise.

8. Adjust: the values of the bottom Light Module Block to: Output - 2, Brightness - 1023, Color - Green.

9. Leave the value of the bottom delay Millis block at: 3000.

10. Click: Upload to Arduino.

11. Observe: the Ellipse Mechanism.

A delay is used to pause the execution of a program or sketch. In this example, there are two 3000 milllisecond (3 second) delays being used. The Ellipse Mechanism will execute the following set of commands for three seconds: A. Rotate Clockwise at full speed.

B. Illuminate Light Module Red at full brightness.

Then, the Ellipse Mechanism will execute the next set of commands for three seconds:

A. Rotate Counter-Clockwise at full speed.

B. Illuminate Light Module Green at full brightness.

Since these sets of commands are connected to the loop function, this process will continue to be executed over and over again.

Page 6: The Arduino IDE & ArduBlock - rokenbokeducation.org. Locate/Open: The Arduino IDE & Ardublock - Video Tutorial. 2 ... code in the Arduino IDE. ... the speed of the Motor Module Block

6

Lesson Challenges

Complete the following challenges using the Ellipse Mechanism and ArduBlock. Place a check in each box as each challenge is completed.

1. Using ArduBlock, create a sketch that commands the Ellipse Mechanism to do the following:

Loop Function

A. Rotate the Ellipse Mechanism counter-clockwise, with a speed value of 850, and B. Illuminate the light module green, with a brightness value of 350.

2. Using ArduBlock, create a sketch that commands the Ellipse Mechanism to do the following:

Loop Function

A. Rotate the Ellipse Mechanism clockwise, with a speed value of 1023, and B. Illuminate the light module green, with a brightness value of 250 For 3 seconds (delay)

Then A. Rotate the Ellipse Mechanism counter-clockwise, with a speed value of 800, and B. Illuminate the light module red, with a brightness value of 500 For 3 seconds (delay)

Disassembly & CleanupPlace a check in each box as each step is completed.

1. Upload: A blank sketch to the ROKduino.

2. Power OFF: the ROKduino.

3. Close out: Arduino & ArduBlock.

4. Disassemble: Ellipse Mechanism.

5. Organize: Components back into Programmable Robotics Module.

Page 7: The Arduino IDE & ArduBlock - rokenbokeducation.org. Locate/Open: The Arduino IDE & Ardublock - Video Tutorial. 2 ... code in the Arduino IDE. ... the speed of the Motor Module Block

7

Build & Modify

InstructionsFollow the step-by-step instructions to assemble the Ellipse Mechanism.

1 2

3x Beam

8x Block

4x Half Beam

1x Motor Module

Motor Cable Port

4x Single Snap Block

1xROK-duino SmartBlock

1x Light Module

3 4

1x Beam

2x Block

2x Half Beam

1x Beam

3x Double-Snap Block

Page 8: The Arduino IDE & ArduBlock - rokenbokeducation.org. Locate/Open: The Arduino IDE & Ardublock - Video Tutorial. 2 ... code in the Arduino IDE. ... the speed of the Motor Module Block

8

Build & ModifyBuild & Modify

65

8x Block

1x Beam

2x Block

2x Half Beam

8x Half Beam

4x Riser

87

4x Riser

4x Mini Curved Beam

8x Single Snap Block

Page 9: The Arduino IDE & ArduBlock - rokenbokeducation.org. Locate/Open: The Arduino IDE & Ardublock - Video Tutorial. 2 ... code in the Arduino IDE. ... the speed of the Motor Module Block

9

Build & Modify

10

8

Build & Modify

9

Flip upside-down and place as shown.

1x Beam

4x Block

2x Half Beam

Connect to yellow Double-Snap block.

Page 10: The Arduino IDE & ArduBlock - rokenbokeducation.org. Locate/Open: The Arduino IDE & Ardublock - Video Tutorial. 2 ... code in the Arduino IDE. ... the speed of the Motor Module Block

10

Build & Modify

11

Build & Modify

1x Beam

6x Block

1x Half Beam

Place on mechanismas shown.

3x Riser

3x Axle Block

4x Pulley

Page 11: The Arduino IDE & ArduBlock - rokenbokeducation.org. Locate/Open: The Arduino IDE & Ardublock - Video Tutorial. 2 ... code in the Arduino IDE. ... the speed of the Motor Module Block

11

Build & ModifyBuild & Modify

Cable DiagramUse the diagram below to connect sensor and motor/output cables to the Ellipse Mechanism.

Inputs

Outputs

Inputs

Outputs

Page 12: The Arduino IDE & ArduBlock - rokenbokeducation.org. Locate/Open: The Arduino IDE & Ardublock - Video Tutorial. 2 ... code in the Arduino IDE. ... the speed of the Motor Module Block

12

Build & ModifyBuild & ModifyROKduino Basics

ROKduino BasicsTo download all necessary ROKduino software, visit: www.rokenbokeducation.org/rokduino.

ROKduino SmartBlock:

The ROKduino is a programmable smartblock that can be used to create different types of robots. It is powered by (3) AA batteries that can be replaced by removing the cover on the bottom of the block. A bright green LED on the top of the block indicates if the ROKduino is ON or OFF. Make sure to power OFF the ROKduino when finished using it to prevent the batteries from running out of power.

Power Indicator ON/OFF Switch

Sensors:

There are a variety of sensors that can be connected to the input ports on the ROKduino. The ROKduino can be programmed to read information from sensors connected to input ports, process that information into relevant commands, and send those commands to modules connected to the output ports.

Light Sensor

Quantity Included: 1(Input Ports 1-8)

Bump Sensor

Quantity Included: 2(Input Ports 1-8)

Angle Sensor

Quantity Included: 1(Input Ports 1-8)

Low PowerIR Transmitter

Quantity Included: 1(Input Ports 1-8)

High PowerIR Transmitter

Quantity Included: 2(Input Ports 1-8)

IR ReceiverSensor

Quantity Included: 2(Input Ports 1-8)

ROK-StarSensor

Quantity Included: 1(Input Port 8)

8 Input Ports

Modules:

There are two modules that can be connected to the output ports on the ROKduino. The ROKduino can be programmed to send out specific commands to the modules to perform different functions. Light Module

Quantity Included: 2(Output Ports 1-4)

Motor Module

Quantity Included: 4(Output Ports 1-4)

Cables:

There are six types of cables that are included with the ROKduino. These cables are used to connect sensors and modules, as well as to connect the ROKduino to a computer so it can be programmed. Make sure cables are pressed all theway into connecting ports to ensure a good connection.

USB Cable

Quantity Included: 1Length: 18”

Sensor Cable

Quantity Included: 8Length: 18”

Sensor Cable Extender

Quantity Included: 2Length: 18”

Motor/Output Cable

Quantity Included: 2Length: 12”

Motor/Output Cable

Quantity Included: 3Length: 18”

Motor/Output Cable Extender

Quantity Included: 2Length: 12”

4 Output Ports

Inputs

Outputs

USB Port

55-02038-200