mirror of
https://github.com/Team4388/2026KPopRobotHunters.git
synced 2026-06-08 16:28:05 -06:00
Update gradle version. Reduce main loop stalling
This commit is contained in:
+1
-1
@@ -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,8 +41,11 @@ public class LED extends SubsystemBase implements Queryable {
|
||||
private LEDPatterns mode = LEDConstants.DEFAULT_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;
|
||||
setTo5V();
|
||||
}
|
||||
|
||||
public String getMode(){
|
||||
@@ -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) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user