티스토리 뷰
Motor control
-
Learning Target: Mastering the basic method of motor control.
-
Effect: The car forward 1 second, right turn 1 second, left turn 1 second, back 1 second, back and right turn 1 second.
에디터 > 새프로젝트를 선택하여 에디터 활성화
https://makecode.microbit.org/#editor
고급 > 확장에서 Maqueen 을 검색하여 다운로드
basic.forever(function () {
maqueen.MotorRun(maqueen.aMotors.M1, maqueen.Dir.CW, 255)
maqueen.MotorRun(maqueen.aMotors.M2, maqueen.Dir.CW, 255)
basic.pause(1000)
maqueen.MotorRun(maqueen.aMotors.M1, maqueen.Dir.CW, 255)
maqueen.MotorRun(maqueen.aMotors.M2, maqueen.Dir.CW, 0)
basic.pause(1000)
maqueen.MotorRun(maqueen.aMotors.M1, maqueen.Dir.CW, 0)
maqueen.MotorRun(maqueen.aMotors.M2, maqueen.Dir.CW, 255)
basic.pause(1000)
maqueen.MotorRun(maqueen.aMotors.M1, maqueen.Dir.CCW, 255)
maqueen.MotorRun(maqueen.aMotors.M2, maqueen.Dir.CCW, 255)
basic.pause(1000)
maqueen.MotorRun(maqueen.aMotors.M1, maqueen.Dir.CCW, 255)
maqueen.MotorRun(maqueen.aMotors.M2, maqueen.Dir.CCW, 0)
basic.pause(1000)
})
'Microbit > Maqueen 로봇' 카테고리의 다른 글
장애물 피하기 (동작영상) (0) | 2020.06.29 |
---|
댓글