from XRPLib.board import Board # This is imported to control the LED
from XRPLib.competition import *
from XRPLib.competition_runner import CompetitionRunner

# Place all initializing code here, aka timer = Timer() , etc.
board = Board.get_default_board()

# This sets competition code to start disabled and on auto. The default otherwise is Teleop and Enabled
competition_set_disabled()
competition_set_mode(COMP_MODE_AUTONOMOUS)


# This runs every time the robot is disabled, and in between teleop and auto switching
def disable_mode():
    pass


# This runs once when auto starts
def auto_init():
    pass


# This repeats when on auto mode
def auto_mode():
    pass


# This runs once when teleop starts
def teleop_init():
    pass


# This repeats when on teleop mode
def teleop_mode():
    pass


# The code below runs the competition transition methods

runner = CompetitionRunner(
    board=board,
    disable_mode=disable_mode,
    auto_init=auto_init,
    auto_mode=auto_mode,
    teleop_init=teleop_init,
    teleop_mode=teleop_mode
)

runner.run() # This runs the main loop