mirror of
https://github.com/Team4388/2026KPopRobotHunters.git
synced 2026-06-09 00:38:03 -06:00
Update gradle version. Reduce main loop stalling
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id "java"
|
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"
|
id "com.peterabeles.gversion" version "1.10"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,8 +41,11 @@ public class LED extends SubsystemBase implements Queryable {
|
|||||||
private LEDPatterns mode = LEDConstants.DEFAULT_PATTERN;
|
private LEDPatterns mode = LEDConstants.DEFAULT_PATTERN;
|
||||||
|
|
||||||
public void setMode(LEDPatterns pattern){
|
public void setMode(LEDPatterns pattern){
|
||||||
|
// Don't stall the main thread every time the setMode function is called
|
||||||
|
if(this.mode != pattern) {
|
||||||
|
setTo5V();
|
||||||
|
}
|
||||||
this.mode = pattern;
|
this.mode = pattern;
|
||||||
setTo5V();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMode(){
|
public String getMode(){
|
||||||
@@ -71,7 +74,7 @@ public class LED extends SubsystemBase implements Queryable {
|
|||||||
public void setTo5V() {
|
public void setTo5V() {
|
||||||
try {
|
try {
|
||||||
m_pwm.setPulseTimeMicroseconds(2125);
|
m_pwm.setPulseTimeMicroseconds(2125);
|
||||||
Thread.sleep(10);
|
Thread.sleep(1);
|
||||||
update();
|
update();
|
||||||
} catch (InterruptedException e) {}
|
} catch (InterruptedException e) {}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user