<commit_before>/*
 * FRC Team 4343
 * Visit us at www.4343.ca
 */
package ca._4343.max3.subsystems;

import ca._4343.RobotMap;
import edu.wpi.first.wpilibj.Solenoid;
import edu.wpi.first.wpilibj.command.Subsystem;

/**
 *
 * @author <NAME> <www.4343.ca>
 * @author <NAME> <www.4343.ca>
 */
public class Lights extends Subsystem {
    
    // Solenoid Module 4
    private final Solenoid red = new Solenoid(4, RobotMap.SOLENOID_RED_LED);
    private final Solenoid green = new Solenoid(4, RobotMap.SOLENOID_GREEN_LED);
    private final Solenoid blue = new Solenoid(4, RobotMap.SOLENOID_BLUE_LED);
    
    /**
     * There is no default state for this subsystem
     */
    public void initDefaultCommand() {
        // range sensor stuff
    }
    
    /**
     * Sets the colour of the LED light strip
     * @param colour Accepts a value of red, green, or blue, case insensitive 
     */
    public void setColour(String colour) {
        if (colour.equalsIgnoreCase("red")) {
            setRed();
        } else if (colour.equalsIgnoreCase("green")) {
            setGreen();
        } else if (colour.equalsIgnoreCase("blue")) {
            setBlue();
        } else {
            turnOff();
        }
    }
    
    /**
     * Turns off other colours first to have enough voltage then turns on red
     */
    private void setRed() {
        blue.set(false);
        green.set(false);
        red.set(true);
    }
    
    /**
     * Turns off other colours first to have enough voltage then turns on red
     */<commit_msg>Added Default Command For Lights Subsystem<commit_after>/*
 * FRC Team 4343
 * Visit us at www.4343.ca
 */
package ca._4343.max3.subsystems;

import ca._4343.RobotMap;
import ca._4343.max3.commands.drivetrain.RangeDetector;
import edu.wpi.first.wpilibj.Solenoid;
import edu.wpi.first.wpilibj.command.Subsystem;

/**
 *
 * @author <NAME> <www.4343.ca>
 * @author <NAME> <www.4343.ca>
 */
public class Lights extends Subsystem {
    
    // Solenoid Module 4
    private final Solenoid red = new Solenoid(4, RobotMap.SOLENOID_RED_LED);
    private final Solenoid green = new Solenoid(4, RobotMap.SOLENOID_GREEN_LED);
    private final Solenoid blue = new Solenoid(4, RobotMap.SOLENOID_BLUE_LED);
    
    /**
     * Always scan for range
     */
    public void initDefaultCommand() {
        setDefaultCommand(new RangeDetector());
    }
    
    /**
     * Sets the colour of the LED light strip
     * @param colour Accepts a value of red, green, or blue, case insensitive 
     */
    public void setColour(String colour) {
        if (colour.equalsIgnoreCase("red")) {
            setRed();
        } else if (colour.equalsIgnoreCase("green")) {
            setGreen();
        } else if (colour.equalsIgnoreCase("blue")) {
            setBlue();
        } else {
            turnOff();
        }
    }
    
    /**
     * Turns off other colours first to have enough voltage then turns on red
     */
    private void setRed() {
        blue.set(false);
        green.set(false);
        red.set(true);
    }
    
    /**
     * Turns off other colours first to have enough voltage then turns on red
     */
{'fraction_non_alphanumeric': 0.1098026734563972, 'fraction_numerical': 0.02005092297899427, 'mean_word_length': 2.2910994764397907, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6332203', 'n_tokens_mistral': 1039, 'n_tokens_neox': 971, 'n_words': 270}