display
λͺ¨λ λμ€νλ μ΄ μ μ΄ λͺ
λ Ήμ μ°¨λ‘λλ‘ μ€ν
from time import sleep
from e_drone.drone import *
from e_drone.protocol import *
if __name__ == '__main__':
drone = Drone()
drone.open()
delay = 0.5
drone.sendDisplayClearAll(DisplayPixel.Black)
sleep(delay)
drone.sendDisplayClear(59, 27, 10, 10, DisplayPixel.White)
sleep(delay)
drone.sendDisplayInvert(54, 22, 20, 20)
sleep(delay)
drone.sendDisplayDrawPoint(64, 32, DisplayPixel.White)
sleep(delay)
drone.sendDisplayDrawLine(10, 10, 118, 54, DisplayPixel.White, DisplayLine.Dotted)
sleep(delay)
drone.sendDisplayDrawRect(44, 12, 40, 40, DisplayPixel.White, False, DisplayLine.Dashed)
sleep(delay)
drone.sendDisplayDrawCircle(64, 32, 20, DisplayPixel.White, True)
sleep(delay)
drone.sendDisplayDrawString(10, 10, "HELLO", DisplayFont.LiberationMono5x8, DisplayPixel.White)
sleep(delay)
drone.sendDisplayDrawStringAlign(0, 128, 30, "E-DRONE", DisplayAlign.Center, DisplayFont.LiberationMono10x16, DisplayPixel.White)
sleep(delay)
drone.close()
무μμ μμΉμ ν¬κΈ°μ Clearλ₯Ό 100ν μ μ‘ (sendDisplayClear ν¨μ μ¬μ©)
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, 100, 1):
width = int(random.randint(0, 127))
height = int(random.randint(0, 63))
x = int(random.randint(0, 127) - width / 2)
y = int(random.randint(0, 63) - height / 2)
pixel = DisplayPixel(int(random.randint(0, 1)))
dataArray = drone.sendDisplayClear(x, y, width, height, pixel)
print("{0} / {1}".format(i, convertByteArrayToString(dataArray)))
sleep(0.03)
drone.close()
무μμ μμΉμ ν¬κΈ°μ Clearλ₯Ό 100ν μ μ‘ (ν΄λμ€ λ°μ΄ν° μ±μμ μ μ‘)
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.DisplayClear
header.length = DisplayClear.getSize()
header.from_ = DeviceType.Tester
header.to_ = DeviceType.Controller
data = DisplayClear()
for i in range(0, 100, 1):
data.width = int(random.randint(0, 127))
data.height = int(random.randint(0, 63))
data.x = int(random.randint(0, 127) - data.width / 2)
data.y = int(random.randint(0, 63) - data.height / 2)
data.pixel = DisplayPixel(int(random.randint(0, 1)))
dataArray = drone.transfer(header, data)
print("{0} / {1}".format(i, convertByteArrayToString(dataArray)))
sleep(0.03)
drone.close()
무μμ μμΉμ κΈΈμ΄μ μ μ 100λ² κ·Έλ¦¬κΈ° (sendDisplayDrawLine ν¨μ μ¬μ©)
import random
from time import sleep
from e_drone.drone import *
from e_drone.protocol import *
if __name__ == '__main__':
drone = Drone()
drone.open()
drone.sendDisplayClearAll(DisplayPixel(int(random.randint(0, 1))))
sleep(0.1)
for i in range(0, 100, 1):
x1 = int(random.randint(0, 127))
y1 = int(random.randint(0, 63))
x2 = int(random.randint(0, 127))
y2 = int(random.randint(0, 63))
pixel = DisplayPixel(int(random.randint(0, 1)))
line = DisplayLine(int(random.randint(0, 2)))
dataArray = drone.sendDisplayDrawLine(x1, y1, x2, y2, pixel, line)
print("{0} / {1}".format(i, convertByteArrayToString(dataArray)))
sleep(0.02)
drone.close()
무μμ μμΉμ ν¬κΈ°μ μμ 100λ² μΆλ ₯νκΈ° (sendDisplayDrawCircle ν¨μ μ¬μ©)
import random
from time import sleep
from e_drone.drone import *
from e_drone.protocol import *
if __name__ == '__main__':
drone = Drone(True, False, False, True, True)
drone.open()
for i in range(0, 100, 1):
x = int(random.randint(0, 127))
y = int(random.randint(0, 63))
radius = int(random.randint(0, 63))
pixel = DisplayPixel(int(random.randint(0, 1)))
flagFill = bool(random.randint(0, 1))
drone.sendDisplayDrawCircle(x, y, radius, pixel, flagFill)
sleep(0.05)
drone.close()
무μμ μμΉμ ν¬κΈ°μ μμ 100λ² μΆλ ₯νκΈ° (ν΄λμ€ λ°μ΄ν° μ±μμ μ μ‘)
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.DisplayDrawCircle
header.length = DisplayDrawCircle.getSize()
header.from_ = DeviceType.Tester
header.to_ = DeviceType.Controller
data = DisplayDrawCircle()
for i in range(0, 100, 1):
data.x = int(random.randint(0, 127))
data.y = int(random.randint(0, 63))
data.radius = int(random.randint(0, 63))
data.pixel = DisplayPixel(int(random.randint(0, 1)))
data.flagFill = bool(random.randint(0, 1))
dataArray = drone.transfer(header, data)
print("{0} / {1}".format(i, convertByteArrayToString(dataArray)))
sleep(0.03)
drone.close()
무μμ μμΉμ ν¬κΈ°μ μ¬κ°νμ 100λ² μΆλ ₯νκΈ° (sendDisplayDrawRect ν¨μ μ¬μ©)
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, 100, 1):
width = int(random.randint(0, 127))
height = int(random.randint(0, 63))
x = int(random.randint(0, 127) - width / 2)
y = int(random.randint(0, 63) - height / 2)
pixel = DisplayPixel(int(random.randint(0, 1)))
flagFill = bool(random.randint(0, 1))
line = DisplayLine(int(random.randint(0, 2)))
dataArray = drone.sendDisplayDrawRect(x, y, width, height, pixel, flagFill, line)
print("{0} / {1}".format(i, convertByteArrayToString(dataArray)))
sleep(0.03)
drone.close()
무μμ μμΉμ ν¬κΈ°μ μ¬κ°νμ 100λ² μΆλ ₯νκΈ° (ν΄λμ€ λ°μ΄ν° μ±μμ μ μ‘)
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.DisplayDrawRect
header.length = DisplayDrawRect.getSize()
header.from_ = DeviceType.Tester
header.to_ = DeviceType.Controller
data = DisplayDrawRect()
for i in range(0, 100, 1):
data.width = int(random.randint(0, 127))
data.height = int(random.randint(0, 63))
data.x = int(random.randint(0, 127) - data.width / 2)
data.y = int(random.randint(0, 63) - data.height / 2)
data.pixel = DisplayPixel(int(random.randint(0, 1)))
data.flagFill = bool(random.randint(0, 1))
data.line = DisplayLine(int(random.randint(0, 2)))
dataArray = drone.transfer(header, data)
print("{0} / {1}".format(i, convertByteArrayToString(dataArray)))
sleep(0.03)
drone.close()
'HELLO' λ¬Έμμ΄μ 무μμ μμΉμ 100λ² μΆλ ₯νκΈ°
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.DisplayDrawString
header.length = DisplayDrawString.getSize()
header.from_ = DeviceType.Tester
header.to_ = DeviceType.Controller
data = DisplayDrawString()
for i in range(0, 100, 1):
data.x = int(random.randint(0, 127))
data.y = int(random.randint(0, 63))
data.font = DisplayFont(int(random.randint(0, 1)))
data.pixel = DisplayPixel(int(random.randint(0, 1)))
data.message = "HELLO"
header.length = DisplayDrawString.getSize() + len(data.message)
dataArray = drone.transfer(header, data)
print("{0} / {1}".format(i, convertByteArrayToString(dataArray)))
sleep(0.03)
drone.close()
'LOVE' λ¬Έμμ΄μ μΌμͺ½, μ€μ, μ€λ₯Έμͺ½ μ λ ¬μ μ¬μ©νμ¬ λ¬΄μμ μμΉμ 10λ² μΆλ ₯νκΈ°
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.DisplayDrawStringAlign
header.length = DisplayDrawStringAlign.getSize()
header.from_ = DeviceType.Tester
header.to_ = DeviceType.Controller
data = DisplayDrawStringAlign()
for i in range(0, 10, 1):
data.x_start = 0
data.x_end = 127
data.y = int(random.randint(0, 63))
data.align = DisplayAlign(int(random.randint(0, 2)))
data.font = DisplayFont(int(random.randint(0, 1)))
data.pixel = DisplayPixel(int(random.randint(0, 1)))
data.message = "LOVE"
header.length = DisplayDrawStringAlign.getSize() + len(data.message)
dataArray = drone.transfer(header, data)
print("{0} / {1}".format(i, convertByteArrayToString(dataArray)))
sleep(0.03)
drone.close()
Last updated