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

Fixed set mode of raw reflection values (mode numbered zero) in simulator for nxt light sensor #1045

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions libs/core/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ namespace sensors.internal {
} else if (newConn == DAL.CONN_NXT_DUMB) {
sensorInfo.devType = inDcm[sensorInfo.port];
control.dmesg(`new NXT DUMB connection at port ${sensorInfo.port} dev type ${sensorInfo.devType}`);
setAnalogMode(sensorInfo.port, sensorInfo.devType, 0);
} else if (newConn == DAL.CONN_INPUT_DUMB) {
//sensorInfo.devType = inDcm[sensorInfo.port]; // We get the result DEVICE_TYPE_UNKNOWN
sensorInfo.devType = DAL.DEVICE_TYPE_TOUCH; // TODO? for now assume touch
Expand Down Expand Up @@ -367,7 +368,6 @@ namespace sensors.internal {
}

_activated() {
this.realmode = 0;
this._setMode(this.mode);
}

Expand Down Expand Up @@ -417,7 +417,6 @@ namespace sensors.internal {
}

protected _setMode(m: number) {
//control.dmesg(`_setMode p=${this.port} m: ${this.realmode} -> ${m}`);
let v = m | 0;
this.mode = v;
if (!this.isActive()) return;
Expand Down