pxt-calliope/docs/reference/led/point-brightness.md
Amerlander 918af4f3ac
Bump V3.0.22 (#110)
* change simulator svg

* change radio image

* Remove google fonts cdn

* change color of 'advanced' button

* font fix

* font fix 2

* display fix

* change fullsceen simulator bg

* Continuous servo

* handle continuous state

* adding shims

* update rendering for continuous servos

* fixing sim

* fix sig

* typo

* fix sim

* bump pxt

* bump pxt

* rerun travis

* Input blocks revision

- add Button and Pin event types
- merge onPinPressed & onPinReleased in new onPinEvent function
- create new onButtonEvent function

* update input blocks in docs and tests

* remove device_pin_release block

* Hide DAL.x behind Enum

* bring back deprecated blocks, but hide them

* shims and locales files

* fix input.input. typing

* remove buildpr

* bump V3

* update simulator aspect ratio

* add Loudness Block

* revoke loudness block

* Adds soundLevel

To be replaced by pxt-common-packages when DAL is updated.

* Remove P0 & P3 from AnalogPin

Co-authored-by: Juri <gitkraken@juriwolf.de>
2020-09-08 02:04:25 -07:00

47 lines
1.2 KiB
Markdown

# Point Brightness
Read the brightness of a LED on the [LED screen](/device/screen).
```sig
led.pointBrightness(0,0);
```
## Parameters
* ``x`` is a [number](/types/number) that means the
horizontal spot on the LED screen (from left to right: 0, 1, 2, 3,
or 4)
* ``y`` is a [number](/types/number) that means the vertical
spot on the LED screen (from top to bottom: 0, 1, 2, 3, or 4)
If a parameter is [out of bounds](/reference/out-of-bounds) (a value
other than 0 to 4), this function will return `false`.
## Returns
* a [number](/blocks/logic/number). If it is `true`, that means the LED is on. If it is `false`, that means the LED is off.
## ~hint
The LED screen is a solid square of LEDs with five LEDs on each side.
To learn more about how you number the LEDs with ``x`` and ``y``
coordinates, see [LED screen](/device/screen).
## ~
## Example: Toggle off
This program turns the center LED (2, 2) off it is not bright enough. (If
it is already off, this program leaves it off.)
```blocks
if (led.pointBrightness(2, 2) < 100) {
led.unplot(2, 2)
}
```
## See also
[unplot](/reference/led/unplot), [plot](/reference/led/plot), [LED screen](/device/screen)