petrone_v2 for python / Examples / Control
Modified : 2017.10.27
이륙, 호버링, 착륙 테스트
from time import sleep
from petrone_v2.drone import *
from petrone_v2.protocol import *
if __name__ == '__main__':
drone = Drone()
drone.open("COM22")
print("TakeOff")
drone.sendTakeOff()
for i in range(2, 0, -1):
print("{0}".format(i))
sleep(1)
print("Hovering")
for i in range(5, 0, -1):
print("{0}".format(i))
drone.sendControlWhile(0, 0, 0, 0, 1000)
sleep(0.01)
print("Landing")
dataArray = drone.sendLanding()
sleep(0.01)
drone.close()
이륙, 조종, 정지 테스트
from time import sleep
from petrone_v2.drone import *
from petrone_v2.protocol import *
if __name__ == '__main__':
drone = Drone()
drone.open("COM22")
print("TakeOff")
drone.sendTakeOff()
sleep(0.01)
print("Hovering")
drone.sendControlWhile(0, 0, 0, 0, 3600)
sleep(0.01)
print("Stop")
drone.sendStop()
sleep(0.01)
drone.close()
petrone_v2 for python
- Intro
- 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