Angles and Patterns
The Driving Base uses motor encoders to make turns.
![engage-1-5](https://assets.education.lego.com/v3/assets/blt293eea581807678a/bltff307e098308e484/5ec7c1427c56c17cfc08a0d5/engage-1-5.jpg?locale=es-es&auto=webp&format=jpeg&width=1800&quality=90&fit=bounds)
This works fine but each time the factory floor gets cleaned, the wheels of the Driving Base slip, which makes it lose its way. Using a Gyro Sensor can help the Driving Base determine its orientation to keep it on track.
In which situations would it be useful to detect changes in orientation so that a robot can navigate?
Build this extension.
![build-1-5](https://assets.education.lego.com/v3/assets/blt293eea581807678a/blt934ee9344e240790/5ec7c140f11f7e3ed6d4d8ee/build-1-5.png?locale=es-es&auto=webp&format=jpeg&width=1800&quality=90&fit=bounds)
The Gyro Sensor extension can be used to navigate along a carefully planned path accurately. Build it onto the Driving Base.
Try these programming stacks one after the other.
![MCR-LV-1-5-Angles-and-Patterns-Cover](https://assets.education.lego.com/v3/assets/blt293eea581807678a/bltb0cfaf29345cbc4c/5ec7c140186b0b0fa5350f31/mcr-lv-1-5-angles-and-patterns-cover.jpg?locale=es-es&auto=webp&format=jpeg&width=1800&quality=90&fit=bounds)
What do you see?
How can My Blocks be used to organize and reuse code?
Your turn!
![explain-1-5](https://assets.education.lego.com/v3/assets/blt293eea581807678a/blt14149c75d41bf776/5ec7c1411df2000f9ba978eb/explain-1-5.png?locale=es-es&auto=webp&format=jpeg&width=1800&quality=90&fit=bounds)
Use blocks from the programming stacks that are already on the Programming Canvas to create a program that turns the Driving Base 90 degrees, drives forward, and finally drives in the specified pattern.
It’s time for a challenge!
![elaborate-1-5](https://assets.education.lego.com/v3/assets/blt293eea581807678a/blt479fd28fe76dcf48/5ec7c140e014445192ea5b99/elaborate-1-5.png?locale=es-es&auto=webp&format=jpeg&width=1800&quality=90&fit=bounds)
Use the Gyro Sensor and My Blocks to program the Driving Base to drive in a square three times and then drive in a triangle.
How did you do?
![evaluate](https://assets.education.lego.com/v3/assets/blt293eea581807678a/blt4724a64ec089e264/5ec7c13ff8b8c35280dbc9a9/evaluate.png?locale=es-es&auto=webp&format=jpeg&width=1800&quality=90&fit=bounds)
What did you do well? Is there anything you could’ve done better?
Cool! Your programs are well organized!