updated brightness docs
This commit is contained in:
parent
3f1505f8f7
commit
62b4168531
@ -14,6 +14,12 @@ led.setBrightness(121)
|
|||||||
`255` (brightest). For example, the number `127` means the screen is
|
`255` (brightest). For example, the number `127` means the screen is
|
||||||
halfway bright when it is turned on.
|
halfway bright when it is turned on.
|
||||||
|
|
||||||
|
### ~ hint
|
||||||
|
|
||||||
|
The brightness is not supported in the simulator. You will need to try it on the @boardname@ itself!
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
### Example: change brightness
|
### Example: change brightness
|
||||||
|
|
||||||
This program makes the screen brightness 100% (`255`). Then it turns on
|
This program makes the screen brightness 100% (`255`). Then it turns on
|
||||||
|
@ -272,7 +272,7 @@ namespace pxsim.led {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function setBrightness(value: number): void {
|
export function setBrightness(value: number): void {
|
||||||
board().ledMatrixState.brigthness = value;
|
board().ledMatrixState.brigthness = Math.max(0, Math.min(255, value));
|
||||||
runtime.queueDisplayUpdate()
|
runtime.queueDisplayUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user