curved move move with makecode mindstorms for lego ev3 · curved move move with makecode mindstorms...

10
Curved Move Move with Makecode Mindstorms for LEGO EV3 This is the third in a series of lessons that are designed to prepare students for Robotics competitions such as RoboCup and First Lego League. The target is students in year 5-8. 1 Lesson References: https://makecode.mindstorms.com/reference/motors/synced/steer https://makecode.mindstorms.com/reference/motors/synced/tank Design Digital 5-6 explanation of how the features of technologies impact on designed solutions for each of the prescribed technologies contexts 7-8 explanation of how the features of technologies impact on designed solutions and influence design decisions for each of the prescribed technologies contexts 5-6 definition of problems in terms of data and functional requirements 7-8 definition and decomposition of problems in terms of functional requirements and constraints 5-6 production of designed solutions by selecting and using appropriate technologies and techniques correctly and safely 7-8 production of effective designed solutions for the intended purpose independently and safely 5-6 implementation of digital solutions, including a visual program 7-8 testing, modification and implementation of digital solutions 5-6 communication of design ideas to audiences using: • graphical representation techniques • technical terms 7-8 communication to different audiences using: • appropriate technical terms • a range of technologies and graphical representation techniques 5-6 design of solutions by: • developing algorithms to address defined problems • incorporating decision making, repetition (iteration) and user interface design 7-8 design of user experiences and algorithms incorporating branching and iterations Predict and explain what these blocks do and how it works Predict and explain what these blocks do and how it works Steer a Curve Steer a Curve Communicate solution Write the Algorithm to Steer a Curve

Upload: others

Post on 23-Mar-2020

25 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Curved Move Move with Makecode Mindstorms for LEGO EV3 · Curved Move Move with Makecode Mindstorms for LEGO EV3 This is the third in a series of lessons that are designed to prepare

Curved Move Move with Makecode Mindstorms for LEGO EV3 This is the third in a series of lessons that are designed to prepare students for Robotics competitions such as

RoboCup and First Lego League. The target is students in year 5-8.

1 Lesson References: https://makecode.mindstorms.com/reference/motors/synced/steer https://makecode.mindstorms.com/reference/motors/synced/tank

Design Digital

5-6 explanation of how the features of technologies

impact on designed solutions for each of the prescribed technologies contexts

7-8 explanation of how the features of technologies

impact on designed solutions and influence design decisions for each of the prescribed technologies contexts

5-6 definition of problems in terms of data and

functional requirements

7-8 definition and decomposition of problems in

terms of functional requirements and constraints

5-6 production of designed solutions by selecting and using appropriate technologies and techniques

correctly and safely

7-8 production of effective designed solutions for the

intended purpose independently and safely

5-6 implementation of digital solutions, including a visual program 7-8 testing, modification and implementation of digital solutions

5-6 communication of design ideas to audiences using:

• graphical representation techniques • technical terms 7-8 communication to different audiences using:

• appropriate technical terms • a range of technologies and graphical representation techniques

5-6 design of solutions by: • developing algorithms to address defined problems • incorporating decision making, repetition (iteration) and user interface design 7-8 design of user experiences and algorithms incorporating branching and iterations

Predict and explain what these blocks do and how it works

Predict and explain what these blocks do and how it works

Steer a Curve Steer a Curve

Communicate solution Write the Algorithm to Steer a Curve

Page 2: Curved Move Move with Makecode Mindstorms for LEGO EV3 · Curved Move Move with Makecode Mindstorms for LEGO EV3 This is the third in a series of lessons that are designed to prepare

Curved Move with Steer Motors block

turnRatio: a number that is the percentage of speed of the drive motor. The follower motor runs at this speed. A negative number steers to the left and a positive number steers to the right. This is a number between -100 and 100.

From <https://makecode.mindstorms.com/reference/motors/synced/steer>

Instructions

Predict and explain what these blocks do and how it works

Video link

https://youtu.be/OB4DZEwLdNo

Page 3: Curved Move Move with Makecode Mindstorms for LEGO EV3 · Curved Move Move with Makecode Mindstorms for LEGO EV3 This is the third in a series of lessons that are designed to prepare

Recreate the program shown, then download and run to test.

Challenge 1

Add three more Steer Motors blocks to your program so that it makes the Driving Base

return to its starting position.

Test your code. If it doesn’t work as expected, alter the parameters and try again until it does.

Page 4: Curved Move Move with Makecode Mindstorms for LEGO EV3 · Curved Move Move with Makecode Mindstorms for LEGO EV3 This is the third in a series of lessons that are designed to prepare

Curved Move with Tank Motors block

Page 5: Curved Move Move with Makecode Mindstorms for LEGO EV3 · Curved Move Move with Makecode Mindstorms for LEGO EV3 This is the third in a series of lessons that are designed to prepare

What are the 3 Types of Turns for an FLL Robot? From <https://www.youtube.com/watch?v=_1r6sVXjClU>

Instructions Predict and explain what these blocks do and how it works

Page 6: Curved Move Move with Makecode Mindstorms for LEGO EV3 · Curved Move Move with Makecode Mindstorms for LEGO EV3 This is the third in a series of lessons that are designed to prepare

Recreate the program shown, then download and run to test.

Challenge 2

Try: Spin Turn

Pivot Turn

Smooth Turn

Page 7: Curved Move Move with Makecode Mindstorms for LEGO EV3 · Curved Move Move with Makecode Mindstorms for LEGO EV3 This is the third in a series of lessons that are designed to prepare

Tank Zig-zag

Coast or Brake on button pressed

Test your code. If it doesn’t work as expected, alter the parameters and try again until it does.

Extension Challenge

=> Develop your algorithm for the challenge below See guide to writing pseudocode at the end.

Page 8: Curved Move Move with Makecode Mindstorms for LEGO EV3 · Curved Move Move with Makecode Mindstorms for LEGO EV3 This is the third in a series of lessons that are designed to prepare

Test your code. If it doesn’t work as expected, alter the parameters and try again until it

does.

Page 9: Curved Move Move with Makecode Mindstorms for LEGO EV3 · Curved Move Move with Makecode Mindstorms for LEGO EV3 This is the third in a series of lessons that are designed to prepare

How to write pseudocode

Operation Pseudocode Programming equivalent

Accepting inputs Get colour sensor value

Events When colour sensor detects a dark colour reflected

Output Actions Play sound effect ______

Set status light to ______

Run _____ motor at ___

Assigning values to variables

Set the variable named ______ to value ___ Change variable named _____ by 1

Logic, Conditionals, Selection and Perform alternative actions

If the condition ____ is true, then execute the following code:

Line of Code Line of Code

If the condition ____ is true, then execute the code inside this block:

Line of Code Line of Code

Else condition not true so execute the code inside this block:

Line of Code Line of Code

Page 10: Curved Move Move with Makecode Mindstorms for LEGO EV3 · Curved Move Move with Makecode Mindstorms for LEGO EV3 This is the third in a series of lessons that are designed to prepare

Loops, Iteration or Repeating operations 1. Repeat forever

Repeat all the code inside the loop forever

Line of Code Line of Code

Loops, Iteration or Repeating operations 2. Pre-test loop — repeat while true

REPEAT while condition ____ is true <code>

Loops, Iteration or Repeating operations 3. Counting loop

Repeat loop ___ times

Code inside block Code inside block