updated brightness docs
This commit is contained in:
1 parent
3f1505f8f7
commit
62b4168531
2 files changed
+7
-1
No files matched your search
@@ -14,6 +14,12 @@ led.setBrightness(121)
|
||||
`255` (brightest). For example, the number `127` means the screen is
|
||||
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
|
||||
|
||||
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 {
|
||||
board().ledMatrixState.brigthness = value;
|
||||
board().ledMatrixState.brigthness = Math.max(0, Math.min(255, value));
|
||||
runtime.queueDisplayUpdate()
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user