-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add-subcategories Add NXT Sensors subcategorie * first-support-version The light sensor gives real values. Mode change not supported... * update * Update ns.ts * sens-sim-support * min-and-max-metod * sim-support-new-chenges * for-sim The simulator now understands that it has an EV3 or NXT analog sensor enabled. The devType value of the virtual sensor will be passed so that the sensor becomes active in the simulator and transmits its values to the simulator. * Update input.ts * add-test * fix-convert-range-bug * Update light.ts Setting the range of values for determining black and white in reflection mode and in ambient light mode is now different. * Update test.ts * Update test.ts * Update test.ts * removing-function-doesnt-work I'm removing an unnecessary function that doesn't work, which I took from the pelikhan change. It does not apply to this change with the sensor and data input. * checking-input-values * set-nxt-light-sensor-svg * Update light.ts * update-for-sim * Update NXT Light Sensor.svg * resolving-conflict-with-master * resolving-conflict-with-master-2 * resolving-conflict-with-master-3 * Update nxtLightSensorView.ts * Update input.ts * value-range-update These numbers were obtained by testing on 4 sensors. The black value is the sensor aimed at the void, and the light value is aimed at the white Lego brick. * Update light.ts * some-changes-for-the-mode * LightWheelControl-is-always-activated-except-in-none-mode LightWheelControl is always activated except in NONE mode. Otherwise, the mode was activated immediately when the sensor was turned on in the simulator, when the operating mode had not yet been activated. * 4096-to-4095 Fix range - 0..4095 * enum-NXTLightIntensityMode * light-sensor-svg-updage * update-light-sensor-ts * ambient-modes-set-invisible Disable the visibility of ambient blocks so that they are not used, because There is no implementation of disabling LED lighting. * range-from-lego-sources https://github.com/mindboards/ev3sources-xtended/blob/master/ev3sources/lms2012/lms2012/Linux_AM1808/sys/settings/typedata.rcf * sim-fix-for-sensor Solving the problem that the field in the simulator and the value from the sensor on the screen could be different. And one more thing... * query-update-and-add-treshold-blocks * test-upd * Update lightWheel.ts * changes-light-sensor-for-sim The changes are aimed at supporting reflection and lighting modes, not raw modes. * deviceType-analog-sens-class * Update light.ts * fix-range-for-refLight-and-ambLight * export-enum-DevConOff * bug-fix-from-previous-version * sensor-activation Setting the mode so that the sensor starts working in the simulator. Otherwise, it, like a touch sensor, does not create view control, because in the touch sensor this was not necessary. Without this change, lightView would only activate if a sensor with type uart was used in the code. * Update light.ts Support blocks have been removed, which may be available later. The ambient mode has been removed, because There is no implementation of turning off the backlight LED. Now it is always on. * Update light.ts * lib-not-include-by-defl Make sure that the library is not included by default. It will need to be enabled via extensions. * light-to-bright * add-docs * Update nxt-light-sensor.md
- Loading branch information
Showing
24 changed files
with
951 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# NXT Light sensor | ||
|
||
The library to interact with the NXT Light Sensor. |
10 changes: 10 additions & 0 deletions
10
libs/nxt-light-sensor/docs/reference/sensors/nxt-light-sensor.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# NXT light sensor | ||
|
||
```cards | ||
sensors.nxtLight1.light(NXTLightIntensityMode.Reflected) | ||
sensors.nxtLight1.light(NXTLightIntensityMode.ReflectedRaw) | ||
``` | ||
|
||
## See slso | ||
|
||
[light](/reference/sensors/nxt-light-sensor/light) |
31 changes: 31 additions & 0 deletions
31
libs/nxt-light-sensor/docs/reference/sensors/nxt-light-sensor/light.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# light | ||
|
||
Get the amount of ambient or reflected light measured by the sensor. | ||
|
||
```sig | ||
sensors.nxtLight1.light(NXTLightIntensityMode.Reflected) | ||
``` | ||
|
||
The light sensor adjusts itself to more accurately measure light depending on the source of the light. You decide if you want to measure _ambient_ light (light all around or direct light) or if you want to know how much light is reflected from a surface. The amount of light measured is in the range of `0` (darkest) to `100` (brightest). | ||
|
||
## Parameters | ||
|
||
* **mode**: the type of measurement for light. This is either ``ambient`` or ``reflected`` light. | ||
|
||
## Returns | ||
|
||
* a number that is the amount of light measured. No light (darkness) is `0` and the brightest light is `100`. | ||
|
||
## Example | ||
|
||
Make the status light show ``green`` if the ambient light is greater than `20`. | ||
|
||
```blocks | ||
forever(function () { | ||
if (sensors.nxtLight1.light(NXTLightIntensityMode.Reflected) > 20) { | ||
brick.setStatusLight(StatusLight.Green) | ||
} else { | ||
brick.setStatusLight(StatusLight.Orange) | ||
} | ||
}) | ||
``` |
Oops, something went wrong.