CoDrone Setup
Table of Contents
Basics for quadcopter movement
Principles of driving method and concept of hovering
[2] Run the installer
[3] Make sure the installation is good
[4] Jupyter notebook & CoDrone installation
[5] Running Jupyter notebook
[6] Create Jupyter notebook
[1] Variable
x = 3
y = 3.14
greet = "Hello World"
[2] Print
print("안녕하세요")
print(greet)
[3] Basic Operator
print(x + y)
print(x < y)
print(x == y)
print(x < y or x > y)
[4] If statement
if x < y :
print("x가 y보다 작습니다.")
if x < y :
print("x가 y보다 작습니다.")
elif x == y:
print("x와 y가 같습니다.")
else:
print("x가 y보다 큽니다.")
[5] For / While statement
print('For Loop:')
for i in range(10):
print(i, end=' ')
print('\nWhile Loop:')
i = 0
while i < 10:
print(i, end=' ')
i += 1
[1] CP210X_Universal_Windows_Driver 설치
[2] CP210x_Universal_Windows_Driver.zip 압축해제
[3] CP210x_Universal_Windows_Driver 폴더에서 아래 설치파일들 중 자신의 OS 에 맞는 설치파일 실행
[4] Bluetooth Module 을 노트북에 연결 (USB 포트)
[5] 윈도우 마크 우클릭 후 장치 관리자 열어서 포트에 아래 항목이 연결되어있는지 확인
[1] Jupyter Notebook 실행
[2] Bluetooth Module 을 아래처럼 master mode 로 설정
- 1 : off, 2 : on
[3] CoDrone Library Import
from CoDrone.codrone import *
[4] Pairing Code 실행 (Nearest Drone Pairing)
drone = CoDrone()
drone.pair(drone.Nearest)
if drone.isConnected():
print('Codrone이 성공적으로 페어링되었습니다.')
drone.close()
[5] 4자리 정수의 Address 을 기록하여 다음 페이링부터는 Address 로 페어링 할 수 있도록 함 (본 예제의 경우 3218)
drone = CoDrone()
drone.pair('3218')
if drone.isConnected():
print('Codrone이 성공적으로 페어링되었습니다.')
[6] 드론의 후미등이 BLINK 에서 Solid로 바뀌었는지 확인
[7] 아래 error가 뜰 경우에는 Bluetooth Module 을 뽑았다가 다시 연결하세요
if drone.isConnected():
drone.set_all_led(Color.Green, Mode.BLINK)
sleep(5)
drone.set_all_led(Color.Green, Mode.OFF)
[2] 예제 코드의 함수 외에 다른 함수를 사용하여 LED 조절해보세요.
# fill your code
%%javascript
$.getScript('https://kmahelona.github.io/ipython_notebook_goodies/ipython_notebook_toc.js')