updated brightness docs

This commit is contained in:
Peli de Halleux 2017-03-24 07:14:37 -07:00
parent 3f1505f8f7
commit 62b4168531
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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()
} }