sim-color-mode-set-defl-val
Prior to this, the color mode was not taken into account. It turns out that the initial value is 50. There is no such index in the array. showPorts didn't output anything for this sensor initially until you chose some color yourself in the simulator. If you look at what the value is there, then 50 is displayed. Therefore, I made the default value 0 - nothing.
This commit is contained in:
parent
8e9240ee92
commit
4b0f133155
@ -66,6 +66,10 @@ namespace pxsim {
|
|||||||
this.color = 0;
|
this.color = 0;
|
||||||
this.colors = [128, 128, 128];
|
this.colors = [128, 128, 128];
|
||||||
this.modeReturnArr = true;
|
this.modeReturnArr = true;
|
||||||
|
} else if (this.mode == ColorSensorMode.Colors) {
|
||||||
|
this.color = 0; // None defl color
|
||||||
|
this.colors = [0, 0, 0];
|
||||||
|
this.modeReturnArr = false;
|
||||||
} else { // Reflection or ambiend light
|
} else { // Reflection or ambiend light
|
||||||
this.color = 50;
|
this.color = 50;
|
||||||
this.colors = [0, 0, 0];
|
this.colors = [0, 0, 0];
|
||||||
|
Loading…
Reference in New Issue
Block a user