Skip to content

Commit

Permalink
changed from DriverStation to alliance color
Browse files Browse the repository at this point in the history
  • Loading branch information
jasondaming committed Dec 9, 2023
1 parent dc26229 commit 972ebb2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
DriverStation Class
===================
Get Alliance Color
==================

The ``DriverStation`` class (`Java <https://first.wpi.edu/wpilib/allwpilib/docs/release/java/edu/wpi/first/wpilibj/DriverStation.html>`__, `C++ <https://github.wpilib.org/allwpilib/docs/beta/cpp/classfrc_1_1_driver_station.html>`__, `Python <https://robotpy.readthedocs.io/projects/wpilib/en/stable/wpilib/DriverStation.html>`__) has many useful features for getting data from the Driver Station computer.
The ``DriverStation`` class (`Java <https://first.wpi.edu/wpilib/allwpilib/docs/release/java/edu/wpi/first/wpilibj/DriverStation.html>`__, `C++ <https://github.wpilib.org/allwpilib/docs/beta/cpp/classfrc_1_1_driver_station.html>`__, `Python <https://robotpy.readthedocs.io/projects/wpilib/en/stable/wpilib/DriverStation.html>`__) has many useful features for getting data from the Driver Station computer. One of the most important features is ``getAlliance`` (Java & Python) / ``GetAlliance`` (C++).

Getting your Alliance Color and Doing an Action
-----------------------------------------------
Expand Down Expand Up @@ -40,6 +40,8 @@ Getting your Alliance Color and Doing an Action

.. code-block:: Python
from wpilib import DriverStation
self.ally = DriverStation.getAlliance()
if self.ally:
if self.ally.value() == DriverStation.Alliance.kRed:
Expand Down
2 changes: 1 addition & 1 deletion source/docs/software/basic-programming/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ Basic Programming
using-test-mode
reading-stacktraces
functions-as-data
driverstation
alliancecolor
java-gc

0 comments on commit 972ebb2

Please sign in to comment.