Your robot is not as swift on their wheels as you are on your feet, so the choice of music is important.
And no doubt its not as debonair as you either.
dance moves must be within the 1.5m squared dance floor
dance routines must be between 15 and 20 seconds
music selection is up to you (no offensive lyrics)
music may be played through the robots speaker or on another device
you may decorate your robot
you may modify your robot
To get started with MakeCode for LEGO MINDSTORMS Education EV3, you’ll need:
A computer with a USB port and internet access through a browser
To upgrade your firmware on the EV3 brick – follow the instructions here
Go to makecode.mindstorms.com and get started trying out some of the tutorials!
We had a lot of fun building this code editor, and hope that you have fun creating amazing programs for your LEGO MINDSTORMS Education EV3 creations!
Have fun Making Code for LEGO MINDSTORMS Education EV3!
Project creation and Recent projects; group all similar programs within the same project & create multiple projects if it makes sense to do so. E.G: create a project for your Mini Skills and another to meet the Dancing Robot Brief.
Program creation and renaming; always rename your programs with a descriptive name and create new programs for different tasks.
P-brick power ON & OFF
P-brick connection and Port View
Input (sensors & input ports); default input ports:
● Port 1; touch sensor
● Port 2; no sensor
● Port 3; colour sensor
● Port 4; infrared sensor
Output (actuators & output ports); default output ports:
● Port A; medium motor
● Port B & C; two large motors
● Port D; large motor
Changing devices and their settings in the Port View
Running a program directly
Downloading a program
move forward at speed 20 on for 1 rotation.
steer left 30º at speed 20 on for 360 degrees,
steer right 30º at speed 20 on for 360 degrees.
light on red no flashing, steer to the left 30º at speed 20 on for 1 sec, wait 2, light off,
light on green flashing, steer to the right 30º at speed 20 on for 1 sec, light off.
When you write more complex code, setting the P-brick lights can be help you determine what part of your program is active.
loop 1 times:
[motor ON at speed 20],
motor OFF & brake
How far did the Robot travel? Any idea why?
Task 05 will answer the question
What does turning on the brake do?
light on red no flashing,
loop 1 times:
[motor ON at speed 20],
motor OFF & brake, light off, wait 2,
light on green no flashing,
loop 9 times:
[motor ON at speed 20],
motor OFF & brake, light off, wait 2,
light on yellow no flashing,
loop 900 times:
[motor ON at speed 20],
motor OFF & brake, light off.
How far did the robot travel for each loop? Any idea why?
Answer: CPUs (even a low spec LEGO CPU) work extremely fast, so by the time the CPU has actioned the turn motor ON command, then exited the loop and turned the motor OFF, the motor has not even begun to turn. Loop 9 times and not much happens; you need to loop many times before the motor has a chance to turn before the CPU turns it OFF.
download an mp3 sound file from internet,
use the Tools/Sound editor to break the sound file into a max of 7 sec chunks,
save to your project.
loop until touch sensor bumped:
[play sound until end of file].
light on yellow no flashing,
loop forever:
[if ultrasonic sensor dist < 20, light on green no flashing, else light on red no flashing].
light on yellow no flashing,
loop forever:
[ultrasonic sensor passes dist to compare block, if within range (15 to 20), light on green no flashing, else light on red no flashing].
loop forever:
[ultrasonic sensor passes dist to, display via wire].
ight on yellow no flashing,
create minRange variable with number 15, create maxRange variable with number 20,
loop forever:
[read variables minRange & maxRange and ultrasonic sensor passing values to compare block, if within range, light on green no flashing, else light on red no flashing].
{calibrate & reset gyro to zero},
loop until gyro >= 90º
[L/H motor ON, at speed 20],
motor OFF & brake,
reset gyro to 0º,
loop until gyro <= -90º:
[R/H motor ON, at speed 20],
motor OFF & brake.
This will require the Gyro to be correctly calibrated, which can only be done successfully if the Gyro is completely still during this process.
One way is to plug it into the Brick, but this results in the Gyro being disturbed and so may fail to calibrate correctly.
The other is via issuing commands; use the Teacher supplied My Block code {reCalGyro.ev3p} to calibrate the Gyro at the start of your program.