2016-10-28 17:34:04 +02:00
|
|
|
|
# Enable
|
|
|
|
|
|
|
|
|
|
Turns the LED screen on and off
|
|
|
|
|
|
|
|
|
|
```sig
|
|
|
|
|
led.enable(false);
|
|
|
|
|
```
|
|
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
|
## Parameters
|
2016-10-28 17:34:04 +02:00
|
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
|
* ``on`` is a [boolean](/types/boolean) that defines the on/off state of the screen
|
2016-10-28 17:34:04 +02:00
|
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
|
## Example: Turning off the screen
|
2016-10-28 17:34:04 +02:00
|
|
|
|
|
|
|
|
|
This program turns off the screen when pressing button ``B``
|
|
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
|
```blocks
|
2022-04-26 19:28:42 +02:00
|
|
|
|
input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
|
2016-10-28 17:34:04 +02:00
|
|
|
|
led.enable(false)
|
|
|
|
|
});
|
|
|
|
|
```
|
|
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
|
## Pins: P3, P4, P6, P7, P9, P10
|
2016-10-28 17:34:04 +02:00
|
|
|
|
|
|
|
|
|
These pins are coupled to the LED matrix display, and also it’s associated ambient light sensing mode.
|
|
|
|
|
To disable the display driver feature (which will automatically disable the light sensing feature) call the DAL function ``led.enable(false)``.
|
|
|
|
|
To turn the display driver back on again later, call ``led.enable(true)``.
|
|
|
|
|
|
|
|
|
|
More information at http://tech.microbit.org/hardware/edgeconnector_ds/ .
|
|
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
|
## See also
|
2016-10-28 17:34:04 +02:00
|
|
|
|
|
|
|
|
|
[unplot](/reference/led/unplot), [point](/reference/led/point), [LED screen](/device/screen)
|