Lesson 2: Turn
이 페이지는 최신 브라우저(SharedArrayBuffer 지원)가 필요합니다. Chrome, Edge, Firefox 또는 Safari를 최신 버전으로 업데이트해 주세요.
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.
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
The goal is 1000 mm to the robot's right. Turn right, then drive into the goal.
출력을 보려면 '실행'을 클릭하세요.
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
Drive to the goal in the top-right corner: 1200 mm up, then 1200 mm to the right.
출력을 보려면 '실행'을 클릭하세요.