Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Add autonomous networktables options #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/auto-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ autoButton.addEventListener('click', () => {
showPanel(autoPanel, 'auto');
});

autoSelect.addEventListener('change', (event) => {
NetworkTables.putValue('/SmartDashboard/Autonomous Mode/active', event.target.value);
});
autoSelect.onchange = function() {
NetworkTables.putValue('/autonomous/selected autonomous', autoSelect.value);
};

startingPosSelect.addEventListener('change', (event) => {
NetworkTables.putValue('/autonomous/starting_position', event.target.value);
});

// Consider key = /SmartDashboard/Autonomous Mode/options
NetworkTables.addKeyListener('/SmartDashboard/Auto List', (_, modes, __) => {

NetworkTables.addKeyListener('/autonomous/autonomous options', (_, modes, __) => {
autoSelect.innerHTML = '';

for (let modeName of modes.reverse()) {
Expand Down