Lesson 2: Turn
Trang này cần trình duyệt gần đây (hỗ trợ SharedArrayBuffer). Vui lòng cập nhật Chrome, Edge, Firefox hoặc Safari lên phiên bản mới nhất.
English
Turning
drivetrain.turn_for(RIGHT, 90, DEGREES)turns the robot on the spot, 90 degrees to the right.- 90 degrees is a quarter turn. 180 degrees turns the robot round to face the other way.
- After a turn,
FORWARDdrives the way the robot now faces.
Words for this lesson
| Word | Meaning |
|---|---|
| turn | change the way the robot faces |
| degrees | how much it turns; a full turn is 360 degrees |
| LEFT / RIGHT | which way to turn |
| heading | the way the robot faces; 0 is up, 90 is right |
English
Drive, turn, drive
from vexcode_vr import *
def main():
drivetrain.drive_for(FORWARD, 500, MM)
drivetrain.turn_for(RIGHT, 90, DEGREES)
drivetrain.drive_for(FORWARD, 500, MM)
vr_thread(main)
- The commands run one after the other, from top to bottom.
- The robot drives up, turns to face right, then drives right.
Độ khó 1/5 · 100 xu + phần thưởng nhỏ khi hoàn thành lần đầu tiên hôm nay
The goal is 1000 mm to the robot's right. Turn right, then drive into the goal.
Nhấn Chạy để xem kết quả ở đây.
Độ khó 2/5 · 140 xu + phần thưởng nhỏ khi hoàn thành lần đầu tiên hôm nay
Drive to the goal in the top-right corner: 1200 mm up, then 1200 mm to the right.
Nhấn Chạy để xem kết quả ở đây.