-
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.
Merge branch 'master' into changes-in-sensors-category
- Loading branch information
Showing
25 changed files
with
952 additions
and
44 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.