Navigation

    Robolink logo
    • Register
    • Login
    • Search
    • [[global:header.categories]]
    • [[global:header.recent]]
    • [[global:header.tags]]
    • [[global:header.popular]]
    • [[global:header.users]]
    • [[global:header.groups]]
    As of September 2021, we have moved technical support to Robolink Help

    Welcome to the Robolink Community forum!

    You can post here to interact with others in the Robolink community. We're checking it weekly, and we'll respond to some messages. If you're looking for technical support, head over to Robolink Help.

    Kill Switch not operating

    CoDrone Troubleshooting
    3
    3
    2580
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      rcron2 last edited by

      I have a STEM class and the students are working through the CoDrone lessons. The problem that they are having (me as well) is that the Kill Switch is not operating. The lesson 2D has the kill switch code incorporated in it but when you run the code the drone will perform the code(most times) but when it doesn't and the kill switch is used nothing happens. What are we doing wrong???? Please help 🙂

      1 Reply Last reply Reply Quote 0
      • robolink_arnold
        robolink_arnold last edited by

        Hello @rcron2 the code

        #include <CoDrone.h>
        
        void setup() {
           CoDrone.begin(115200);
           CoDrone.pair();
        
           CoDrone.takeoff(); //goes up and hovers for 3 seconds
           CoDrone.hover(2); //hovers for 2 seconds
           CoDrone.land(); //lands the CoDrone 
        }
        
        void loop(){    
           byte bt8 = digitalRead(18);    
           byte bt4 = digitalRead(14);    
           byte bt1 = digitalRead(11);
        
           if(bt1 && bt4 && !bt8){    
           CoDrone.emergencyStop();
           }
        }
        

        has a killswitch inside the loop, since the setup code is doing one line after another it will take time to get to the inside of the loop. The killswitch is there for once the program is over if the CoDrone is still flying you can make it land. You can also double-click the BLE modules black button to kill the drone mid-program. Let me know if you have any other questions.

        1 Reply Last reply Reply Quote 0
        • robolink_wes
          robolink_wes last edited by

          Hi @rcron2! I'm wondering if maybe your sensors aren't adjusted, so maybe the IR sensors aren't picking up that something is in front of it, so it won't trigger.

          Can you post the code you're using? I'm assuming it's the same code as the example code in 2D, but I want to be sure.

          Also, there's a white dial on the Smart Inventor board. If you turn it to the right, your sensors will get more sensitive, and if you turn it to the left, they become less sensitive. Give that a shot, to see if the killswitch is actually triggering. If you're on the latest version of our library ("CoDrone" version 2.0.1 in the Library Manager), you should hear a sound effect for the killswitch. If you still don't see a response, let me know, and we can see if we need to set up a call.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post