diff --git a/src/main/java/org/jointheleague/jcodrone/TestPorts.java b/src/main/java/org/jointheleague/jcodrone/TestPorts.java index 0b7ef8b..24665f9 100644 --- a/src/main/java/org/jointheleague/jcodrone/TestPorts.java +++ b/src/main/java/org/jointheleague/jcodrone/TestPorts.java @@ -10,15 +10,29 @@ public static void main(String argx[]) { Thread.sleep(2000); drone.flyDirect(new DirectControl((byte) 0, (byte) 0, (byte) 0, (byte) 0)); Thread.sleep(200); -// drone.sendCommandWait(CommandType.FLIGHT_EVENT, FlightEvent.TAKEOFF.value()); + drone.takeoff(); Thread.sleep(2000); - LightMode mode = new LightModeBuilder().setColor("BLUE").setInterval(5).setMode(LightModeDrone.ARM_HOLD).build(); + for (int i = 0; i < 3; i++) { + LightMode mode = new LightModeBuilder().setColor("BLUE").setInterval(5).setMode(LightModeDrone.EYE_HOLD).build(); + drone.lightMode(mode); + Thread.sleep(100); + drone.flyDirect(new DirectControl((byte) 0, (byte) 0, (byte) 55, 30)); + Thread.sleep(2000); + mode = new LightModeBuilder().setColor("RED").setInterval(5).setMode(LightModeDrone.EYE_HOLD).build(); + drone.lightMode(mode); + Thread.sleep(100); + drone.flyDirect(new DirectControl((byte) 0, (byte) 0, (byte) -55, -20)); + Thread.sleep(2000); + } + drone.flyDirect(new DirectControl((byte) 0, (byte) 0, (byte) 0, (byte) 0)); + Thread.sleep(200); + LightMode mode = new LightModeBuilder().setColor("BLUE").setInterval(5).setMode(LightModeDrone.EYE_HOLD).build(); drone.lightMode(mode); Thread.sleep(1000); mode = new LightModeBuilder().setColor("green").setInterval(200).setMode(LightModeDrone.EYE_DIMMING).build(); drone.lightMode(mode); Thread.sleep(3000); -// drone.sendCommandWait(CommandType.FLIGHT_EVENT, FlightEvent.LANDING.value()); + drone.land(); Thread.sleep(1000); } catch (Exception e) { e.printStackTrace();