Skip to main content Link Menu Expand (external link) Document Search Copy Copied

void attachFn(function<void()> autonFunction)

Sets the auton function for the selector.

Parameters

  • autonFunction - The function that should be run when the dials are set to the given values.

Example

PotDial dial1 = PotDial(Brain.ThreeWirePort.A, 3, 100, true);

//Runs when dial1 is 1
SelectorArr selector = SelectorArr({1});

selector.attachFn([](){
    Brain.Screen.print("Auton 1");
});