CodingDrone for python / Examples / Vibrator
Modified : 2024.6.13
sendVibrator 함수 테스트
from time import sleep
from CodingDrone.drone import *
from CodingDrone.protocol import *
if __name__ == '__main__':
drone = Drone()
drone.open()
drone.sendVibrator(100, 200, 1200)
sleep(1)
drone.close()
Vibrator 클래스 데이터를 직접 채워서 전송하기
from time import sleep
from CodingDrone.drone import *
from CodingDrone.protocol import *
if __name__ == '__main__':
drone = Drone()
drone.open()
header = Header()
header.dataType = DataType.Vibrator
header.length = Vibrator.getSize()
header.from_ = DeviceType.Tester
header.to_ = DeviceType.Controller
data = Vibrator()
data.mode = VibratorMode.Instantly
data.on = 100
data.off = 200
data.total = 1200
drone.transfer(header, data)
sleep(1)
drone.close()
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