28 lines
		
	
	
		
			838 B
		
	
	
	
		
			Java
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			838 B
		
	
	
	
		
			Java
		
	
	
	
	
	
| // Copyright (c) FIRST and other WPILib contributors.
 | |
| // Open Source Software; you can modify and/or share it under the terms of
 | |
| // the WPILib BSD license file in the root directory of this project.
 | |
| 
 | |
| package frc.robot.subsystem;
 | |
| 
 | |
| import edu.wpi.first.wpilibj.AddressableLED;
 | |
| import edu.wpi.first.wpilibj.AddressableLEDBuffer;
 | |
| import edu.wpi.first.wpilibj2.command.SubsystemBase;
 | |
| 
 | |
| public class LED extends SubsystemBase {
 | |
|   /** Creates a new LED. */
 | |
|   public LED() {}
 | |
|    AddressableLED led = new AddressableLED(9);
 | |
|    AddressableLEDBuffer ledBuffer = new AddressableLEDBuffer(60);
 | |
|    public void led(){
 | |
|     led.setData(ledBuffer);
 | |
|     led.start();
 | |
|    }
 | |
|    public void couleur(int R, int G, int B){
 | |
|     ledBuffer.setRGB(0, R, G, B);
 | |
|    }
 | |
|   @Override
 | |
|   public void periodic() {
 | |
|     // This method will be called once per scheduler run
 | |
|   }
 | |
| }
 |