Other Ways to Upload a Program to Ev3

MINDSTORMS EV3 Core Set

Object Detection

Design ways to avoid accidents between vehicles and objects in the road.

road-deer

Connect

( five minutes )

Ignite a classroom discussion around the following questions:

  • In what driving situations can a auto striking an obstacle?
  • What factors are crucial to be aware of in club to avoid collisions with obstacles?
  • What causes traffic jams in loftier density areas?

Permit the students to select the tool(south) they observe most appropriate for capturing and sharing their ideas. Encourage them to certificate their thoughts using text, videos, images, sketchnotes, or another creative medium.

Construct

( xv to 30 minutes )

Build
Students will construct the Robot Educator base of operations model, and so they will add the Ultrasonic Sensor pointing forwards.

ev3-robot-driving-base

Accept the students perform the following edifice bank check earlier they program their robots:

  • Are the wires correctly connected from the motors to ports B and C?
  • Are the wheels correctly installed?
  • Are the wheels rotating freely?
  • Are the wires correctly connected from the Ultrasonic Sensor to 4?

Program
Introduce the simple use of the Ultrasonic Sensor.
Demonstrate the Wait Block and how to employ it with the Ultrasonic Sensor.
Ask the students how they could make a plan to detect any obstacles that might announced while the wheeled robot is moving frontwards (or astern).
Students will create a plan that makes the robot stop at a given point based on a altitude measured by the Ultrasonic Sensor.
Allow the students to select the tool(s) they detect most appropriate for capturing and sharing their pseudocode. Encourage them to utilise text, videos, images, sketchnotes, or some other creative medium.

POSSIBLE SOLUTION
FILENAME: CODING-05.EV3 (TAB: 1)

Coding-05-01

DETECT OBJECTS AND STOP

  1. Start the program.
  2. Turn both motors on at speed fifty.
  3. Look for the Ultrasonic Sensor to find an obstacle at a altitude of less than 20 cm.
  4. Turn both motors off.

Note
Refer students to the Robot Educator Tutorials for further assistance.
In the EV3 Software :
Robot Educator > Basics > Terminate at Object

Set up
Earlier assigning the side by side task, make sure that you lot have marked the path the robots must follow and that at that place is plenty infinite to complete the task. It is a good idea to have students work on a big table or on the floor.
Have the students experiment with using the Ultrasonic Sensor to detect different objects. One of the objects tin can be a cuboid made of LEGO® bricks.

ev3-cuboid

Contemplate

( 35 minutes )

On the road, when a driver sees an object, they deadening their car down before coming to a full stop.
Have the students program their robots with the same behavior.
If the Ultrasonic Sensor:

  • Detects an object less than 10 cm away, make the robot finish
  • Detects an object between 10 and twenty cm away, make the robot slow downwardly
  • Does not find whatsoever object, continue to move at full speed

POSSIBLE SOLUTION
FILENAME: CODING-05.EV3 (Tab: 2)

Coding-05-02

DETECT OBJECTS AND REACT

  1. Start the program.
  2. Turn both motors on at speed 50.
  3. IF the Ultrasonic Sensor detects an obstacle at a distance of less than 10 cm, turn both motors off.
    ELSE
  4. IF the Ultrasonic Sensor detects an obstacle at a distance of less than 20 cm, turn both motors on at speed 10.
    ELSE
  5. Turn both motors on at speed 50.
  6. Repeat steps 3 to vii forever.

Differentiation option
Bring all of the teams together.
Tell the students to place their robots in a vertical line with varying amounts of space between them (just like cars in a traffic jam).
Accept them start their programs at the same time and watch what happens.
• Ask the students to refine their programs so that all of the robots go on driving at the aforementioned speed with equal distances between them (like well-flowing traffic on a road).

Share
Let the students to select the tool(s) they find near advisable for capturing and sharing their creations, unique thinking, and learning process. Encourage them to use text, videos, images, sketchnotes, or another creative medium.
Talk over the concept of efficiency in programming.
How many variations did the grouping equally a whole come up up with? Compare the many possible solutions to the given problem.

Cess Opportunity
Specific rubrics for assessing computational thinking skills can exist found under 'Assessment'.

Continue

( 45 minutes )

Using Text-Based Programming
Have the students explore text-based programming solutions so they tin can compare different programming languages.

MakeCode - POSSIBLE SOLUTION

Program with Blocks or JavaScript in your web browser using Microsoft MakeCode editor for LEGO® MINDSTORMS® Didactics EV3.
You can find the Object Detection Activity Here

Swift Playground - POSSIBLE SOLUTION

                    While true { ev3.motility (leftPort: .b, rightPort: .c, leftPower: fifty, rightPower: 50) While ev3.measureUltrasonicCentimeters (on : .4) < twenty { ev3.stopMove (leftPort: .b, rightPort: .C) } }                                      

ROBOT C: POSSIBLE SOLUTION

                    #pragma config(Sensor, S4, sonarSensor, sensorEV3 _ Ultrasonic) #pragma config(Motor, motorB, leftMotor, tmotorEV3 _ Large, PIDControl, driveLeft, encoder) #pragma config(Motor, motorC, rightMotor, tmotorEV3 _ Large, PIDControl, driveRight, encoder) /* Create a plan that drives the robot forrad until the Ultrasound Sensor sees an object. The robot then stops. */ task master() { //Set motor speed at l% (Drive Forward). setMotorSpeed(motorB, fifty); setMotorSpeed(motorC, 50); while(getUSDistance(sonarSensor) < 20) { //Keep going until the Ultrasonic Sensor sees a value less than 20cm. } //Once the Ultrasonic Sensor sees a value less than 20cm. //Set up motor speed to 0% (End). setMotorSpeed(motorB, 0); setMotorSpeed(motorC, 0); }                                      

Alert! This may be dangerous!

The post-obit is a possible solution using the text-based programming language ROBOTC. Yous may choose to apply any other LEGO MINDSTORMS Instruction EV3 uniform text-based programming languages.
LEGO Education has no ownership of the ROBOTC platform and does not provide any support or guarantee of the quality of the user experience and engineering used. All required prepare information is provided past ROBOTC at robotc.cyberspace. Nosotros recommend always to reinstall the official LEGO MINDSTORMS EV3 Brick firmware when y'all finish using other programming languages.

Guide to reinstalling EV3 Brick

Other Programme Solutions

Swift Playground - POSSIBLE SOLUTION

                    While true { if ev3.measureUltraSonicCentimeters (on : .four) < 20 { if ev3.measureUltrasonicCentimeters (on: .four) < 10  { ev3.stopMove(leftPort: .b, rightPort: .c) else  { ev3.move(leftPort: .b, rightPort: .c, leftPower: 10, rightPower: x) } } else  { ev3.motility(leftPort: .b, rightPort: .c, leftPower: 50, rightPower: 50) } }                                      

ROBOT C: POSSIBLE SOLUTION

Teacher Support

Students will:
Extend agreement of the Loop

Student Material

Student Worksheet

Download to view and share the student worksheet.

taylorobbigh52.blogspot.com

Source: https://education.lego.com/en-au/lessons/mindstorms-ev3/object-detection

0 Response to "Other Ways to Upload a Program to Ev3"

Postar um comentário

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel