-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add doc & example for headlight support
- Loading branch information
Showing
3 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
### Headlight | ||
|
||
You can set the brightness of the LEDs of this set using the `LEDLight` class and its | ||
`set_brightness` method. Accepted values are between 0 and 100%. | ||
|
||
Example to make the LEDs blink: | ||
|
||
```python | ||
import time | ||
from pylgbst.hub import MoveHub | ||
|
||
hub = MoveHub() | ||
# Blink forever | ||
while True: | ||
# Headlight is on port D; set its brightness to 100% | ||
hub.port_D.set_brightness(100) | ||
time.sleep(1) | ||
# Shutdown the ligth | ||
hub.port_D.set_brightness(0) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters