Update gradle version. Reduce main loop stalling

This commit is contained in:
Michael Mikovsky
2026-02-12 10:18:12 -07:00
parent 9ea8193935
commit 3e701df6fa
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
plugins {
id "java"
id "edu.wpi.first.GradleRIO" version "2026.1.1"
id "edu.wpi.first.GradleRIO" version "2026.2.1"
id "com.peterabeles.gversion" version "1.10"
}
@@ -41,9 +41,12 @@ public class LED extends SubsystemBase implements Queryable {
private LEDPatterns mode = LEDConstants.DEFAULT_PATTERN;
public void setMode(LEDPatterns pattern){
this.mode = pattern;
// Don't stall the main thread every time the setMode function is called
if(this.mode != pattern) {
setTo5V();
}
this.mode = pattern;
}
public String getMode(){
return mode.name();
@@ -71,7 +74,7 @@ public class LED extends SubsystemBase implements Queryable {
public void setTo5V() {
try {
m_pwm.setPulseTimeMicroseconds(2125);
Thread.sleep(10);
Thread.sleep(1);
update();
} catch (InterruptedException e) {}
}