vibrator

sendVibrator 함수 테스트

1
from time import sleep
2
3
from e_drone.drone import *
4
from e_drone.protocol import *
5
6
7
if __name__ == '__main__':
8
9
drone = Drone()
10
drone.open()
11
12
drone.sendVibrator(100, 200, 1200)
13
sleep(1)
14
15
drone.close()
Copied!

Vibrator 클래스 데이터를 직접 채워서 전송하기

1
from time import sleep
2
3
from e_drone.drone import *
4
from e_drone.protocol import *
5
6
7
if __name__ == '__main__':
8
9
drone = Drone()
10
drone.open()
11
12
13
header = Header()
14
15
header.dataType = DataType.Vibrator
16
header.length = Vibrator.getSize()
17
header.from_ = DeviceType.Tester
18
header.to_ = DeviceType.Controller
19
20
data = Vibrator()
21
22
data.mode = VibratorMode.Instantally
23
data.on = 100
24
data.off = 200
25
data.total = 1200
26
27
drone.transfer(header, data)
28
sleep(1)
29
30
31
drone.close()
Copied!
Last modified 1yr ago