Hello! I am currently starting work with the REVBlinkin. We have the LEDs hooked up to the 5V Port and plugged into PWM port 9 on the RoboRio. When we plug it in it turns on, but we are trying to program specific colors onto it. For example, the LEDs would activate when picking up an object. I have provided my current code. Could someone provide guidance as to how we should proceed for the commands?
package frc.robot.subsystems;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import edu.wpi.first.wpilibj.motorcontrol.Spark;
public class RevBlinkin extends SubsystemBase {
private static Spark m_blinkin = null;
public RevBlinkin() {
m_blinkin = new Spark(9);
solid_orange();
}
public void set(double val) {
if ((val >= -1.0) && (val <= 1.0)) {
m_blinkin.set(val);
}
}
public void rainbow() {
set(-0.99);
}
public void solid_orange() {
set(0.65);
}
}