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

Conversation

THEb0nny
Copy link
Contributor

@THEb0nny THEb0nny commented Feb 4, 2024

The _setMode() method was called, and just like at the beginning of this.mode = 0, this.realmode = 0, the algorithm in _setMode checks this.realmode != this.mode and only then calls setAnalogMode(), in which the mode is passed to the simulator.

When we find the DAL.CONN_NXT_DUMB sensor in detectDevices(), we additionally call setAnalogMode(). Perhaps the same thing needs to be done for DAL.CONN_INPUT_DUMB, but there is only one analog sensor ev3 (touch sensor), and it works without this change. This way you set the mode forcibly when the sensor is found, i.e. at the beginning.

I did the same thing as when finding DAL.CONN_INPUT_UART, in that case updateUartMode() is called.

When we find the DAL.CONN_NXT_DUMB sensor, we additionally call setAnalogMode(), which passes the sensor mode to the simulator. Perhaps the same thing needs to be done for DAL.CONN_INPUT_DUMB, but there is only one analog sensor ev3 (touch sensor), and it works without this change.
@THEb0nny THEb0nny changed the title Fixed setting the mode of raw reflection values (mode numbered zero) in the simulator Fixed setting the mode of raw reflection values (mode numbered zero) in the simulator for nxt light sensor Feb 4, 2024
@THEb0nny
Copy link
Contributor Author

THEb0nny commented Feb 4, 2024

2024-02-04_09-28-12.mp4

@THEb0nny
Copy link
Contributor Author

THEb0nny commented Feb 4, 2024

2024-02-04_09-32-45.mp4

@THEb0nny THEb0nny changed the title Fixed setting the mode of raw reflection values (mode numbered zero) in the simulator for nxt light sensor Fixed set mode of raw reflection values (mode numbered zero) in simulator for nxt light sensor Feb 4, 2024
@THEb0nny
Copy link
Contributor Author

THEb0nny commented Feb 4, 2024

@jwunderl you may want to consider this bugfix to the previous change. I initially forgot that there was such a problem, now I have fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant