light
sendLightManual() ν¨μλ₯Ό μ¬μ©νμ¬ μ‘°μ’
κΈ° LED μ μ΄νκΈ°
import random
from time import sleep
from e_drone.drone import *
from e_drone.protocol import *
if __name__ == '__main__':
drone = Drone()
drone.open()
drone.sendLightManual(DeviceType.Controller, 0xFF, 0)
sleep(1);
drone.sendLightManual(DeviceType.Controller, LightFlagsController.BodyRed.value, 10)
sleep(1);
drone.sendLightManual(DeviceType.Controller, LightFlagsController.BodyRed.value, 100)
sleep(1);
drone.sendLightManual(DeviceType.Controller, LightFlagsController.BodyRed.value, 0)
sleep(1);
drone.sendLightManual(DeviceType.Controller, LightFlagsController.BodyGreen.value, 10)
sleep(1);
drone.sendLightManual(DeviceType.Controller, LightFlagsController.BodyGreen.value, 100)
sleep(1);
drone.sendLightManual(DeviceType.Controller, LightFlagsController.BodyGreen.value, 0)
sleep(1);
drone.sendLightManual(DeviceType.Controller, LightFlagsController.BodyBlue.value, 10)
sleep(1);
drone.sendLightManual(DeviceType.Controller, LightFlagsController.BodyBlue.value, 100)
sleep(1);
drone.sendLightManual(DeviceType.Controller, LightFlagsController.BodyBlue.value, 0)
sleep(1);
drone.sendLightManual(DeviceType.Controller, 0b00000011, 10)
sleep(1);
drone.sendLightManual(DeviceType.Controller, 0b00000011, 100)
sleep(1);
drone.sendLightManual(DeviceType.Controller, 0b00000011, 0)
sleep(1);
drone.sendLightManual(DeviceType.Controller, 0b00000110, 10)
sleep(1);
drone.sendLightManual(DeviceType.Controller, 0b00000110, 100)
sleep(1);
drone.sendLightManual(DeviceType.Controller, 0b00000110, 0)
sleep(1);
drone.sendLightManual(DeviceType.Controller, 0b00000101, 10)
sleep(1);
drone.sendLightManual(DeviceType.Controller, 0b00000101, 100)
sleep(1);
drone.sendLightManual(DeviceType.Controller, 0b00000101, 0)
sleep(1);
drone.close()
sendLightManual() ν¨μλ₯Ό μ¬μ©νμ¬ λλ‘ LED μ μ΄νκΈ°
from time import sleep
from e_drone.drone import *
from e_drone.protocol import *
if __name__ == '__main__':
drone = Drone()
drone.open()
drone.sendLightManual(DeviceType.Drone, 0xFF, 0)
sleep(1);
drone.sendLightManual(DeviceType.Drone, LightFlagsDrone.BodyRed.value, 10)
sleep(1);
drone.sendLightManual(DeviceType.Drone, LightFlagsDrone.BodyRed.value, 100)
sleep(1);
drone.sendLightManual(DeviceType.Drone, LightFlagsDrone.BodyRed.value, 0)
sleep(1);
drone.sendLightManual(DeviceType.Drone, LightFlagsDrone.BodyGreen.value, 10)
sleep(1);
drone.sendLightManual(DeviceType.Drone, LightFlagsDrone.BodyGreen.value, 100)
sleep(1);
drone.sendLightManual(DeviceType.Drone, LightFlagsDrone.BodyGreen.value, 0)
sleep(1);
drone.sendLightManual(DeviceType.Drone, LightFlagsDrone.BodyBlue.value, 10)
sleep(1);
drone.sendLightManual(DeviceType.Drone, LightFlagsDrone.BodyBlue.value, 100)
sleep(1);
drone.sendLightManual(DeviceType.Drone, LightFlagsDrone.BodyBlue.value, 0)
sleep(1);
drone.sendLightManual(DeviceType.Drone, 0x06, 10)
sleep(1);
drone.sendLightManual(DeviceType.Drone, 0x06, 100)
sleep(1);
drone.sendLightManual(DeviceType.Drone, 0x06, 0)
sleep(1);
drone.sendLightManual(DeviceType.Drone, 0x0A, 10)
sleep(1);
drone.sendLightManual(DeviceType.Drone, 0x0A, 100)
sleep(1);
drone.sendLightManual(DeviceType.Drone, 0x0A, 0)
sleep(1);
drone.sendLightManual(DeviceType.Drone, 0x0C, 10)
sleep(1);
drone.sendLightManual(DeviceType.Drone, 0x0C, 100)
sleep(1);
drone.sendLightManual(DeviceType.Drone, 0x0C, 0)
sleep(1);
drone.close()
sendLightMode, sendLightEvent ν¨μλ₯Ό μ¬μ©νμ¬ μ‘°μ’
κΈ° LED μ μ΄νκΈ°
from time import sleep
from e_drone.drone import *
from e_drone.protocol import *
if __name__ == '__main__':
drone = Drone()
drone.open()
print("BodyHold")
drone.sendLightModeColor(LightModeController.BodyHold, 200, 200, 200, 0)
sleep(2);
#sendLightModeColor
print("BodyDimming 1")
drone.sendLightModeColor(LightModeController.BodyDimming, 3, 200, 0, 200)
sleep(3);
#sendLightModeColors
print("BodyDimming 2")
drone.sendLightModeColors(LightModeController.BodyDimming, 3, Colors.Cyan)
sleep(3);
# sendLightEventColor*
print("BodyDimming 3")
drone.sendLightEventColor(LightModeController.BodyDimming, 3, 3, 200, 200, 200)
sleep(3);
# sendLightEventColors*
print("BodyDimming 4")
drone.sendLightEventColors(LightModeController.BodyDimming, 3, 3, Colors.Magenta)
sleep(3);
drone.close()
sendLightMode, sendLightEvent ν¨μλ₯Ό μ¬μ©νμ¬ λλ‘ LED μ μ΄νκΈ°
from time import sleep
from e_drone.drone import *
from e_drone.protocol import *
if __name__ == '__main__':
drone = Drone()
drone.open()
drone.sendLightModeColor(LightModeDrone.BodyHold, 200, 0, 200, 200)
sleep(1);
# sendLightModeColor*
drone.sendLightModeColor(LightModeDrone.BodyDimming, 3, 0, 0, 200)
sleep(3);
# sendLightModeColors*
drone.sendLightModeColors(LightModeDrone.BodyDimming, 3, Colors.Cyan)
sleep(3);
# sendLightEventColor*
drone.sendLightEventColor(LightModeDrone.BodyDimming, 3, 5, 200, 200, 200)
sleep(3);
# sendLightEventColors*
drone.sendLightEventColors(LightModeDrone.BodyDimming, 3, 3, Colors.Magenta)
sleep(3);
drone.close()
μ‘°μ’
κΈ°μ LEDλ₯Ό λλ€ν μμΌλ‘ μ μ λ°μμ‘λ€ μ΄λμμ§κ² νλ λͺ
λ Ήμ 10ν μ€ν
LightModeColor / sendLightModeColor ν¨μ μ¬μ©
import random
from time import sleep
from e_drone.drone import *
from e_drone.protocol import *
if __name__ == '__main__':
drone = Drone()
drone.open()
for i in range(0, 10, 1):
r = int(random.randint(0, 255))
g = int(random.randint(0, 255))
b = int(random.randint(0, 255))
dataArray = drone.sendLightModeColor(LightModeController.BodyDimming, 1, r, g, b)
print("{0} / {1}".format(i, convertByteArrayToString(dataArray)))
sleep(0.6)
drone.close()
μ‘°μ’
κΈ°μ LEDλ₯Ό λλ€ν μμΌλ‘ μ μ λ°μμ‘λ€ μ΄λμμ§κ² νλ λͺ
λ Ήμ 10ν μ€ν
LightModeColor / ν΄λμ€ λ°μ΄ν°λ₯Ό μ±μμ μ μ‘
import random
from time import sleep
from e_drone.drone import *
from e_drone.protocol import *
if __name__ == '__main__':
drone = Drone()
drone.open()
header = Header()
header.dataType = DataType.LightMode
header.length = LightModeColor.getSize()
header.from_ = DeviceType.Tester
header.to_ = DeviceType.Controller
data = LightModeColor()
data.mode.mode = LightModeController.BodyDimming.value
data.mode.interval = 1
for i in range(0, 10, 1):
data.color.r = int(random.randint(0, 255))
data.color.g = int(random.randint(0, 255))
data.color.b = int(random.randint(0, 255))
dataArray = drone.transfer(header, data)
print("{0} / {1}".format(i, convertByteArrayToString(dataArray)))
sleep(0.6)
drone.close()
μ‘°μ’
κΈ°μ LEDλ₯Ό λλ€ν μμΌλ‘ μ μ λ°μμ‘λ€ μ΄λμμ§κ² νλ λͺ
λ Ήμ 10ν μ€ν
LightModeColors / sendLightModeColors ν¨μ μ¬μ©
import random
from time import sleep
from e_drone.drone import *
from e_drone.protocol import *
if __name__ == '__main__':
drone = Drone()
drone.open()
for i in range(0, 10, 1):
colors = Colors(random.randint(0, Colors.EndOfType.value))
dataArray = drone.sendLightModeColors(LightModeController.BodyDimming, 1, colors)
print("{0} / {1}".format(i, convertByteArrayToString(dataArray)))
sleep(0.6)
drone.close()
μ‘°μ’
κΈ°μ LEDλ₯Ό λλ€ν μμΌλ‘ μ μ λ°μμ‘λ€ μ΄λμμ§κ² νλ λͺ
λ Ήμ 10ν μ€ν
LightModeColors / ν΄λμ€ λ°μ΄ν°λ₯Ό μ±μμ μ μ‘
import random
from time import sleep
from e_drone.drone import *
from e_drone.protocol import *
if __name__ == '__main__':
drone = Drone()
drone.open()
header = Header()
header.dataType = DataType.LightMode
header.length = LightModeColors.getSize()
header.from_ = DeviceType.Tester
header.to_ = DeviceType.Controller
data = LightModeColors()
data.mode.mode = LightModeController.BodyDimming.value
data.mode.interval = 1
for i in range(0, 10, 1):
data.colors = Colors(random.randint(0, Colors.EndOfType.value))
dataArray = drone.transfer(header, data)
print("{0} / {1}".format(i, convertByteArrayToString(dataArray)))
sleep(0.6)
drone.close()
λλ‘ μ LEDλ₯Ό λλ€ν μμΌλ‘ μ μ λ°μμ‘λ€ μ΄λμμ§κ² νλ λͺ
λ Ήμ 10ν μ€ν
LightModeColors / sendLightDefaultColor ν¨μ μ¬μ©
import random
from time import sleep
from e_drone.drone import *
from e_drone.protocol import *
if __name__ == '__main__':
drone = Drone(True, True, True, True, True)
drone.open()
for i in range(0, 10, 1):
r = int(random.randint(0, 255))
g = int(random.randint(0, 255))
b = int(random.randint(0, 255))
dataArray = drone.sendLightDefaultColor(LightModeDrone.BodyDimming, 1, r, g, b)
print("{0} / {1}".format(i, convertByteArrayToString(dataArray)))
sleep(2)
drone.close()
Last updated