Mission: Joyride
The Joyride mission is a creativity based challenge where competitors will try to get to a target location by programming their own control scheme using only the IR sensors of their controller. 

IMG_1815

Summary

The challenge will be to fly the CoDrone from one point to another by using a custom made control scheme.  Each competitor will develop their own controls utilizing the IR sensors on the smart inventor board.   Creative freedom is encourage and some approaches will be more effective than others.

An example of code is shown below:

First you need to make sure you’re reading all of your sensor values:

Then create if-statements to control your CoDrone.  For example, this if-statement says
“If my leftmost IR sensor (bt1) and rightmost IR sensor (bt8) are triggered, and bt2 is not and bt8 is not, then THROTTLE = 60″

Notice there is only one CoDrone.Control() at the end of the loop:

Use this map to figure out which sensors correspond to which pins:  Pin-Out Guide

 

How to Play:

Begin this challenge by writing your code to control you CoDrone without the joysticks.  Make sure you include a kill-switch.

  1. Players will each write their own code
  2. Begin by placing the CoDrone in the start zone
  3. Try to navigate to the landing zone and land

Use a timer to see who can accomplish this feat the fastest.  Try trading controllers and seeing who’s controls are the easiest to learn.

 

Customization:

Analog Sensors

Utilize the top row of Analog Sensors to make your code unique:

Remember analog values range from 0 – 1023

Flappy Bird Style

Adding this to your code will make the CoDrone continuously lose altitude unless given an action:

Constant Turn

This will make your CoDrone spin to the right when no commands are pressed:

 

Comprehensive Example:

There can be multiple variations of this mission ranging in difficulty.  A few variations will include:

  • Checkpoints that the CoDrone must pass through
  • Limit the number of sensors that can be used
  • Create diagonal commands
  • For RokitSmart owners: Create a moving landing pad with the RokitSmart kit and try to land on it using the CoDrone

The kill-switch can be used to land in the landing zone. Challenges should be timed for competitions.

Customize and try to make the best CoDrone controller!