CodingDrone for python / Drone
Modified : 2024.6.13
Command Line 명령어를 소개합니다.
- Command Line 명령어
- 1. Firmware Upgrade
- 2. Request Data
- 3. Command
- 3. Control
- 4. buzzer
- 5. vibrator
- 6. light
Command Line 명령어
CodingDrone 라이브러리는 소스 코드 작성없이 원하는 명령을 실행하거나 데이터를 확인할 수 있는 command line 명령어를 지원하고 있습니다. 아래에서 소개하는 명령어를 실행하여 간단하게 데이터를 확인하거나 작동해보시기 바랍니다.
> python -m CodingDrone

실행 가능한 명령 리스트
1. Firmware Upgrade
파이썬 라이브러리를 사용하여 드론 펌웨어를 업데이트하는 명령입니다. 드론 또는 조종기를 부트로더 모드로 USB에 연결하신 후 아래의 명령을 실행하시면 됩니다.
> python -m CodingDrone upgrade
2. Request Data
데이터 요청
2.1. State 데이터 요청
State 데이터를 10회 0.2초 주기로 요청하는 명령은 다음과 같습니다.
> python -m CodingDrone request State 10 0.2

State 요청 실행 결과
2.2. Motion 데이터 요청
Motion 데이터를 10회 0.2초 주기로 요청하는 명령은 다음과 같습니다.
> python -m CodingDrone request Motion 10 0.2

Motion 요청 실행 결과
3. Command
명령
2.1. 이륙
> python -m CodingDrone takeoff
2.2. 착륙
> python -m CodingDrone landing
2.3. 정지
> python -m CodingDrone stop
3. Control
3.1. 조종 명령

조종 명령 예시 - Roll, Pitch, Yaw, Throttle
> python -m CodingDrone control 0 30 0 0 5000
3.2. 조종 명령(위치, 방향)

조종 명령 예시 - 위치, 방향
> python -m CodingDrone position 5 0 0 2 90 45
3.3. 조종 명령(위치)

조종 명령 예시 - 위치
> python -m CodingDrone position 5 0 0 2
3.4. 조종 명령(방향)

조종 명령 예시 - 방향
> python -m CodingDrone heading 90 45
4. buzzer
버저
4.1. 버저 작동

버저 작동 예시
400Hz의 소리를 2000ms 동안 내게 합니다.
> python -m CodingDrone buzzer 400 2000
5. vibrator
진동
5.1. 진동 작동

진동 작동 예시
500ms동안 켜고, 500ms 동안 끄는 동작을 2000ms 동안 실행
> python -m CodingDrone vibrator 500 500 2000
6. light
LED 제어
6.1. 단색 LED 제어
단색 LED 제어 시 아래와 같은 순서로 명령을 내리면 됩니다.
python -m CodingDrone light [rear, a, b] [hold, flicker, flickerdouble, dimming, sunrise, sunset] [interval]
hold 상태일 때 interval은 밝기를 의미합니다. 값의 범위는 0 ~ 255입니다.

단색 LED 작동 예시
> python -m CodingDrone light rear hold 100
> python -m CodingDrone light a hold 100
> python -m CodingDrone light b hold 100
6.2. RGB LED 제어
RGB LED 제어 시 아래와 같은 순서로 명령을 내리면 됩니다.
python -m CodingDrone light [body] [hold, flicker, flickerdouble, dimming, sunrise, sunset, rainbow, rainbow2] [interval] [R] [G] [B]
hold 상태일 때 interval은 밝기를 의미합니다. 값의 범위는 0 ~ 255입니다.
R, G, B 모두 값의 범위는 0 ~ 255입니다.

RGB LED 작동 예시
> python -m CodingDrone light body hold 100 50 50 10
> python -m CodingDrone light body flicker 100 50 50 10
> python -m CodingDrone light body flickerdouble 100 50 50 10
> python -m CodingDrone light body dimming 3 50 50 10
> python -m CodingDrone light body sunrise 5 50 50 10
> python -m CodingDrone light body sunset 5 50 50 10
> python -m CodingDrone light body rainbow 8 50 50 10
> python -m CodingDrone light body rainbow2 8 50 50 10
CodingDrone for python
- Intro
- Command Line
- System
- Protocol
- Drone
- Examples - Ping
- Examples - Information
- Examples - Pairing
- Examples - Control
- Examples - Sensor
- Examples - Motor
- Examples - Setup
- Examples - Buzzer
- Examples - Vibrator
- Examples - Light
- Examples - Display
- Examples - Input
- Examples - Error