Closed THEb0nny closed 9 months ago
Implemented support for the simulator. All that remains is to change the svg image for the sensor. Later I'll draw it in Illustrator.
I note that the analog touch sensor also works. I tested this on hardware as well.
I have verified that the problem with two nxt analog light sensors, the problem with duplicate values is gone. Maybe I did something wrong during testing before. As a result, the sensors show different values. First of all, this concerns hardware; I also tested it on hardware.
@jwunderl please look at this change
Conflicts arose because the changes were based on the old version. It takes some time to solve them.
Everything seems to be working.
@jwunderl look here please?
There are currently two modes of raw reflection values and a reflection mode being implemented. The mode of external consecration is hidden, because The backlight LED must be turned off. I couldn't do it. According to the developers’ scheme, pin 5 should not be supplied with power, but I don’t know how to implement this now.
Simulator support is also implemented.
The implementation of this sensor does not interfere with the operation of the ev3's other analog sensor, the touch sensor.
There is also an issue with the documentation, I will implement it in full later.
This is a beta version of the library, but it is already needed now so that children can use this sensor. As I use it, I find problems and solve them. As I use it, I find problems and solve them.
https://github.com/microsoft/pxt-ev3/assets/13646226/ed7d5183-916d-4a54-ab0a-a77c24da30ba
https://photos.app.goo.gl/xuUM93NHKnazHCvJ7 Video on hardware. Line 3 reflective sensor nxt in raw mode.
First support code for nxt light sensor analog sensor. The sensor gives real values. If the sensor is pulled out of the port, then the value is 4096. The default mode is reflection mode with the backlight turned on. Support for switching modes is not implemented.
Some of the code was taken from here... https://github.com/microsoft/pxt-ev3/pull/948
I will work on changing the mode of operation.