Skip to content

Commit 0465eb8

Browse files
committed
docs(wokwi-leds): explain the fps attribute
1 parent dc7cf36 commit 0465eb8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/parts/wokwi-led.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Standard 5mm LED.
2323
| label | Text that appears below the led | |
2424
| gamma | Gamma correction factor | "2.8" |
2525
| flip | Flips the led horizontally | "" |
26+
| fps | The framerate of the LED | "80" |
2627

2728
Note: To rotate LEDs, click on them and press "R", or set the ["rotate" property](../diagram-format#parts).
2829

@@ -52,6 +53,14 @@ The [Gamma Correction Demo project](https://wokwi.com/projects/30476298871006880
5253

5354
For more information about _gamma correction_, including some code examples, check out this [great guide from Adafruit](https://learn.adafruit.com/led-tricks-gamma-correction).
5455

56+
### FPS
57+
58+
The `fps` attribute controls the framerate of the LED, that is how often the LED brightness is updated. The default value is 80.
59+
60+
If you are using PWM (`analogWrite()`) and noticing flickering, try setting a smaller the `fps` value.
61+
62+
In case you are experiencing LED light ghosting, you can try increasing the `fps` value. For example, this [rotating cube](https://wokwi.com/projects/355020415991153665) uses an `fps` value of 10000 to update the LEDs at a higher rate and avoid ghosting of the rotating cube.
63+
5564
## Simulator examples
5665

5766
- [Blink](https://wokwi.com/projects/344891652101374548) - Arduino's standard Blink sketch

0 commit comments

Comments
 (0)