My block

"My Blocks" are blocks/functions that you create and custom.

my-Block-meaning

How to make a "My Block"?

my-Block-how

1- Press "Make a Block"

2- Name your "Block"

3- You can either add an input and add another name.

4- You can see that you have the variable you named.

You can make as many blocks as you need. You can add as many input as you need as well!


Build the entire robot by:

If you have not done so

IMG-2019 IMG-2018

Change "degrees"

deg

-> Degrees is an INPUT

-> You can edit the "degrees" how you want it.

-> Notice that I set the motors B and C

-> Notice I made the speed 50% forward.

Go Forward

a waitss BABY ROBOT (3)
1-my-Block

600 degrees Forward.

Go backward

 300
2-my-Block

600 degrees Backward (since it's negative).


Change "speed"

speed

-> Speed is an INPUT

-> You can edit the "speed" how you want it.

-> Notice that I made 2 input for speed: Left and Right

-> But the robot will ALWAYS move 600 degrees

-> If speed is negative, 600 degrees backward.

Go Forward

block BABY ROBOT
4-my-Block

600 degrees forward speed of 75%

Go backward

block BABY ROBOT (1)
4-my-Block

600 degrees backward speed of 30%


Change "Degree" and "Speed"

deg-speed

-> "Degrees" and "Speed" is an INPUT

-> You can edit the "degrees" and "speed" how you want it.

-> Notice that the 3 circular input it's taken

Go Forward

block BABY ROBOT (2)
5-my-Block

Robot moves 450 degrees forward at the speed of 45%

Pivot Turn

block BABY ROBOT (3)
6-my-Block

Robot makes a pivot turn of 650 degrees. Left wheel at speed of 0%. Right wheel at the speed of 60%

Spin Turn

block BABY ROBOT (4)
7-my-Block

Robot makes a spin turn to the left of 340 degrees at speed of 30.


Advanced: Turning right using Gyro Sensor

my-Block-right-gyro
block BABY ROBOT (5)

Robot uses Gyro Sensor to make an accurate turn of 180 degrees to the right.

1-Wait[Robot spin turn to the right] Until[180 degrees condition is met]

2- Robot stop moving.

8-my-Block

You can edit:

-> Degrees (1st input)

-> Speed (2nd input)

⚠ If it's not acccurate, substract or add more degrees in the degrees input.

Advanced: Turning left using Gyro Sensor

my-Block-left-gyro
block BABY ROBOT (6)

Robot uses Gyro Sensor to make an acurate turn of 180 degrees to the right.

1-Wait[Robot spin turn to the right] Until[180 degrees condition is met]

2- Robot stop moving.

9-my-Block

You can edit:

-> Degrees (1st input)-> Negative

-> Speed (2nd input)

⚠ If it's not acccurate, substract or add more degrees in the degrees input

Observations: Why is "My block" important for programming?


Observations: Question


Why can't I delete MyBlock?

It's because you are still using it. Marke sure that you are not using any of this block in order to delete it.

Time for a quiz!

Question goes here