-
Notifications
You must be signed in to change notification settings - Fork 6
RoboRio Ports
The roboRIO is a mess of ports which all accept different voltages and communication standards. More information can be found here: [1]
RoboRIO ports From the NI roboRIO user Manual for FRC
From the NI roboRIO user Manual for FRC:
Digital Input/Output (DIO): Used for certain digital sensors, like limit switches or encoders (more about these later). R2-232 I2C port: Can be used with one of the NAVX gyros CAN (Controller Area Network) port: Used to power/signal TalonSRX's and the pneumatics control module Power connector: Gets wired to the Power Distribution Board USB device port: This port provides one way that the laptop can interface with the roboRIO (for loading code or driving the robot, for example). It is more reliable than the ethernet connection. This port is USBb female. USB Host Retention Mount: used for securing USB devices plugged into the RIO (like a camera, for instance). USB Host ports: used for interfacing the roboRIO with USB devices like a camera or the NAVX gyro Ethernet port: used for communicating with the wireless mesh radio or interfacing with the laptop (through an ethernet cord). Serial peripheral interface (SPI) bus: used for interfacing with certain sensors like the Gyro included in the Kit of Parts. LEDs for status:
The roboRIO’s FPGA supports up to 26 digital inputs. 10 of these are made available through the built-in DIO ports on the RIO itself, while the other 16 are available through the MXP breakout port.
Digital inputs read one of two states - “high” or “low.” By default, the built-in ports on the RIO will read “high” due to internal pull-up resistors (for more information, see Digital Inputs - Hardware). Accordingly, digital inputs are most-commonly used with switches of some sort. Support for this usage is provided through the DigitalInput class (Java, C++).
// Initializes a DigitalInput on DIO 0
DigitalInput input = new DigitalInput(0);// Gets the value of the digital input. Returns true if the circuit is open.
input.get();// Initializes an AnalogTrigger on port 0
AnalogTrigger trigger0 = new AnalogTrigger(0);
// Initializes an AnalogInput on port 1 and enables 2-bit oversampling
AnalogInput input = new AnalogInput(1);
input.setAverageBits(2);
// Initializes an AnalogTrigger using the above input
AnalogTrigger trigger1 = new AnalogTrigger(input);To convert the analog signal to a digital one, it is necessary to specify at what values the trigger will enable and disable. These values may be different to avoid “dithering” around the transition point:
// Sets the trigger to enable at a raw value of 3500, and disable at a value of 1000
trigger.setLimitsRaw(1000, 3500);
// Sets the trigger to enable at a voltage of 4 volts, and disable at a value of 1.5 volts
trigger.setLimitsVoltage(1.5, 4);Spark spark = new Spark(0);
// Limit switch on DIO 2
DigitalInput limit = new DigitalInput(2);
public void autonomousPeriodic() {
// Runs the motor forwards at half speed, unless the limit is pressed
if(!limit.get()) {
spark.set(.5);
} else {
spark.set(0);
}
}This is an officially licensed product of Team 4026. Decatur Robotics 2024 is not sponsored by any other Team, and is not responsible for any damages caused by using this product or trusting the programming team, which is by far the least most trustworthy team(Shadow owen money gang, we love coding the robot). By using this product, you are consenting to your information, and thus your identity to be stolen and first-born child taken.
- Editing Documentation & Markdown Syntax
- Code Team to-do List
- Code Standards
- Common Library Structure
- Interfaces
- General Setup
- Branching System
- How to Create Pull Requests
- How to Switch Branches
- Code Reviews
- Reverting Commits
- Singleton Pattern
- Software Installations
- Necessary IntelliJ Plugins
- Vendordeps
- Setting Up New Projects
- Autoformatter Set Up
- Showbot Requirements
- Autonomous
- Calling a Command Based on a Button Press
- CAN
- Clearing Sticky Faults
- Current Limits
- PID Config and Usage
- Robot.java, TeleopInit, DisabledInit
- RoboRio Ports
- SetDefaultCommand
- Wait for Time
- SlewRateLimiter
- LEDs
- InstantCommand
- PhotonVision
- Apriltags
- Camera Display on Shuffleboard
- Object Detection
- Raspberry Pi
- Network Tables
- List of Network Tables (2023)
Up to date as of SJ2, end of 2023 season