Thrifty Nova
  • Software Resources
    • Getting Started
    • Configure Controller Settings
      • Factory Default
      • Motor Type - Minion Setting
      • Inverting the Motor
      • Brake Mode
      • Maximum Output
      • Ramp Up/Ramp Down
      • Current Limiting
      • Soft Limits
      • Hard Limits
      • Setting Encoder Position
      • Follower Mode
    • Configure Onboard PID
    • Configure CAN Frequency
    • IO Signal Management
    • Set Output
    • Logging
    • Get Feedback
    • Unit Conversions
    • Subsystem Examples
      • Simple Elevator Example
      • Swerve Module Example
      • Simple Arm Example
  • Electrical Resources
    • Wiring the Thrifty Nova
    • LED Color Codes
    • Brushless Hall Sensor Connector
    • USB Communications
    • 10 Pin Data Connector
      • Intro to Sensors
      • Sensor Hat
      • Motor Runner Board
    • Hard Reset
  • Mechanical
    • Mounting Options
  • Software Releases
    • Software Releases
  • Thrifty Config
    • Thrifty Config Demo Video
Powered by GitBook
On this page
  • API Install
  • Basic Device Usage
  • Lets break that down...

Was this helpful?

Export as PDF
  1. Software Resources

Getting Started

NextConfigure Controller Settings

Last updated 3 months ago

Was this helpful?

To get started using the Thrifty Nova you must use the ThriftyLib.

ThriftyLib only has support for Java at this time. Support for C++ and Python are coming soon.

API Install

To install the ThriftyLib beta, please paste the following link into the WPILIB VSCode:

Basic Device Usage

Before we break it down, here is a template to demonstrate simple ThriftyNova API usage.

public class MySubsystem extends Subsystem {
  private volatile MySubsystem instance; // singleton instance

  private ThriftyNova motor; // motor instance

  private MySubsystem() { // constructor initialization 
    motor = new ThriftyNova(7); // creates motor with CAN ID 7
  }

  public void periodic() { // update method called periodically 
    motor.setPercent(1); // set motor to output full forward 
  }

  public synchronized MySubsystem getInstance() {  // singleton getter
    return instance == null ? instance = new Instance() : instance;
}

Lets break that down...

Each Thrifty Nova is represented by an object. You must create a ThriftyNova instance variable in your subsystem to hold this object.

private ThriftyNova motor;  

To actually instantiate the motor we call the ThrifyNova constructor. The constructor takes the CAN ID of the motor as a parameter.

motor = new ThriftyNova(7);

In order to command the motor we use various setters. To set the output percentage of the motor we use the setPercent method. The method takes an argument from -1.0, full reverse, to 1.0, full forward, where 0 is idle.

motor.setPercent(1.0);   // 100% forward
motor.setPercent(0.75);  // 75% forward
motor.setPercent(0);     // off
motor.setPercent(-0.25); // 25% reverse
motor.setPercent(-1.0);  // 100% reverse
https://docs.home.thethriftybot.com/ThriftyLib/Latest/ThriftyLib.json