Robolink

Mission 6: High Noon

 Snap Mission 6: High Noon
This mission is much like a carnival shooting game, the CoDrone will move side to side and users will try to time it so that when it goes forward it hits a target.

Summary

The High Noon mission will be a timing based challenge.  The CoDrone will be programmed to Roll side to side continuously.  Targets or random objects will be aligned in a row across from the CoDrone, much like a shooting gallery.  When a sensor is triggered, the CoDrone will pitch forward at high speed.  The competitors will compete by trying to knock down as many objects/targets as possible.  The kill switch will be allowed and the Throttle control will be preserved for altitude control.

 

We will start by programming the Throttle so that we can keep it in the air. The up and down arrow keys will control the throttle. We will have it loop forever and send the throttle values here.


Next we need to add in the constant rolling side to side. We will have it move one second in each direction (if needed this time can be adjusted for a larger or smaller area). To add this into our Throttle control code would be difficult. So what we can do is have a separate forever loop that will be setting the Roll values. It will not have a sending command in it though, it will use the sending command in the Throttle control so that we are only sending to the CoDrone once. The roll value is saved in one loop (the loop we will add) and then sent through the throttle loop.

Then we will add in another part of the code that will move the CoDrone forward after we press a button. We need to be sure that it also stops the other programs so that it will stop moving side to side as it goes forward. We will have it move forward for 3 seconds, if needed this time can be extended. Once the 3 seconds have passed we will have it land.

 

Then we will put all of these together along with a kill command to make the full code.