Skip to content

Configuring Bailout Button

Jeffrey Shen edited this page May 16, 2017 · 4 revisions

Bailout

It is helpful to have a button, for safety purposes, that stops all motors if the motor is malfunctioning. The library provides functionality to do that.

Setup

In config.c:

#define USE_BAILOUT 1
#define BAILOUT_BTN Btn7D //This is the button that when pressed, causes the bailout procedure

In addition, you need to define a method void bailOut() which should contain custom procedures to be run during the bailout procedure (motors are already automatically shut off).

Example

#define USE_BAILOUT 1
#define BAILOUT_BTN Btn7D //This is the button that when pressed, causes the bailout procedure
void bailOut(){
  //Execute something here
}

Usage

Everything is set up now! If you press BAILOUT_BTN during user control, it will halt all motors and execute your custom bailOut method.

Clone this wiki locally