Skip to content

Commit

Permalink
Updated TestPorts to do some simple flying.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Cerruti authored and e3-cerruti committed Jan 12, 2018
1 parent d1545d0 commit 919962a
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/main/java/org/jointheleague/jcodrone/TestPorts.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 919962a

Please sign in to comment.