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!


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

myBlock-forward
1-my-Block

600 degrees Forward.

Go backward

Backward
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

a myBlock
3-my-Block

600 degrees forward speed of 75%

Go backward

a myBlock-backward-speed
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

a myBlock (2)
5-my-Block

Robot moves 450 degrees forwars at the speed of 45%

Pivot Turn

a myBlock (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

a myBlock (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
a myBlock (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)

Advanced: Turning left using Gyro Sensor

my-Block-left-gyro
a myBlock (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)

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