Java/C++
VS Code
To add a vendor library that has been installed by an offline installer, press Ctrl+Shift+P and type WPILib or click on the WPILib icon in the top right to open the WPILib Command Palette and begin typing Manage Vendor Libraries, then select it from the menu. Select the option to Install new libraries (offline).
Select the desired libraries to add to the project by checking the box next to each, then click OK. The JSON file will be copied to the vendordeps
folder in the project, adding the library as a dependency to the project.
In order to install a vendor library in online mode, press Ctrl+Shift+P and type WPILib or click on the WPILib icon in the top right to open the WPILib Command Palette and begin typing Manage Vendor Libraries and select it in the menu, and then click on Install new libraries (online) instead and copy + paste the vendor JSON URL.
Checking for Updates (Offline)
Since dependencies are version managed on a per-project basis, even when installed offline, you will need to Manage Vendor Libraries and select Check for updates (offline) for each project you wish to update.
Checking for Updates (Online)
Part of the JSON file that vendors may optionally populate is an online update location. If a library has an appropriate location specified, running Check for updates (online) will check if a newer version of the library is available from the remote location.
Coming soon.
This documentation explains how to use the MitoCANdria Java API to control and monitor your MitoCANdria device. The example demonstrates basic channel operations including reading current/voltage, enabling/disabling channels, and setting voltage levels.
The MitoCANdria class implements AutoCloseable
, allowing use of try-with-resources for automatic resource cleanup. The constructor parameter (1) represents the device ID.
The API provides several predefined channels:
MITOCANDRIA_CHANNEL_USB1
: USB Port 1
MITOCANDRIA_CHANNEL_USB2
: USB Port 2
MITOCANDRIA_CHANNEL_5VA
: 5V Rail A
MITOCANDRIA_CHANNEL_5VB
: 5V Rail B
MITOCANDRIA_CHANNEL_ADJ
: Adjustable Voltage Channel
Uses getChannelCurrent()
to read current draw from a channel
Returns an Optional
containing the current in amperes
Uses ifPresentOrElse()
for handling both successful and failed readings
Uses getChannelVoltage()
to read voltage from a channel
Returns an Optional
containing the voltage in volts
Uses ifPresentOrElse()
for error handling
Uses setChannelEnabled()
to control channel state
Parameters: channel constant, boolean enable state (true = enabled)
Uses setChannelVoltage()
to set voltage on adjustable channels
Only works with MITOCANDRIA_CHANNEL_ADJ
Second parameter is desired voltage in volts
Uses getChannelVoltageSetpoint()
to read the configured voltage
Useful for verifying voltage settings on adjustable channels
Uses getChannelEnabled()
to check if a channel is active
Returns 1 for enabled, 0 for disabled
The example uses a try-catch block to handle potential exceptions:
For additional assistance or questions about the MitoCANdria Java API, please contact:
Email: contact@thethriftybot.com