Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes in mode change for color sensor #1025

Merged
merged 13 commits into from
Jul 18, 2023
Prev Previous commit
Next Next commit
Update color.ts
  • Loading branch information
THEb0nny committed Jul 15, 2023
commit fe6f90ee1f1b7d43f9f63f52b74b10adb6a06e73
2 changes: 1 addition & 1 deletion libs/color-sensor/color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ namespace sensors {
if (m != this.mode && this.isActive()) { // If the new mode is different from what was set for the sensor
//const previousValue = this.mode == ColorSensorMode.RgbRaw ? this._queryArr()[0] : this._query(); // Before changing the mode, remember what the value was
this._setMode(m); // Change mode
const startChangeTime = control.millis();
//const startChangeTime = control.millis();
pause(MODE_SWITCH_DELAY);
pauseUntil(() => (this.getStatus() == 8 && (this.mode == ColorSensorMode.RgbRaw ? this._queryArr()[0] : this._query()) < 1024)); // Pause until mode change
/*
Expand Down