-
Notifications
You must be signed in to change notification settings - Fork 6
Limit Switches
What is a Limit Switch?
Limit switches are some of the simplest sensors used on the robot. They connect to the RIO as a digital input device, capable of transmitting a 'high' or 'low' signal (1 and 0, respectively). These signals correspond to the device being either in the open or closed state (when contacted or when exposed to open air). Thus, we can use these to determine if a mechanism has reached a 'maximum' or 'minimum' position based on if it contacts the switch. For example, we could use it to make sure an arm does not exceed a certain limit of extension.
Usage in WPILib
In WPILib, these switches are super easy to implement, with the DigitalInput class and constructor:
DigitalInput limitSwitch = new DigitalInput(port number);
...
// returns true if switch is tripped, false if not
if (limitSwitch.get()) {
arm.doThingOne(); // limit reached, arm will do something
}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