Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wink
firmware
Commits
282949d1
Verified
Commit
282949d1
authored
5 years ago
by
rahix
Browse files
Options
Downloads
Patches
Plain Diff
doc: Fix minor Pycardium module docs issues
Signed-off-by:
Rahix
<
rahix@rahix.de
>
parent
c3f473e6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Documentation/pycardium/leds.rst
+9
-4
9 additions, 4 deletions
Documentation/pycardium/leds.rst
pycardium/modules/py/color.py
+17
-1
17 additions, 1 deletion
pycardium/modules/py/color.py
with
26 additions
and
5 deletions
Documentation/pycardium/leds.rst
+
9
−
4
View file @
282949d1
...
...
@@ -5,16 +5,21 @@
Set one of the card10's RGB LEDs to a certain color.
Example which sets all LEDs on the top to red:::
**Example**:
.. code-block:: python
import leds, color
# Set all of the top LEDs to red
for i in range(11):
leds.set(i, color.RED)
:param led: Which led to set. 0-10 are the leds on the top and 11-14 are the 4 "ambient" leds.
:param color: What color to set the led to. Should be a :py:class:`color.Color` but any list/tuple
with 3 elements will work just as well.
:param led: Which led to set. 0-10 are the leds on the top
and 11-14 are the 4 "ambient" leds.
:param color: What color to set the led to. Should be a
:py:class:`color.Color` but any list/tuple with 3 elements
will work just as well.
.. py:data:: leds.BOTTOM_RIGHT
...
...
This diff is collapsed.
Click to expand it.
pycardium/modules/py/color.py
+
17
−
1
View file @
282949d1
...
...
@@ -32,10 +32,26 @@ class Color(_ColorTuple):
@classmethod
def
from_hex
(
cls
,
color
):
"""
Create a color from a hexadecimal number::
Create a color from a hexadecimal number.
This function is available both as a class method and directly inside
the color module:
**Example**:
.. code-block:: python
from color import Color
# Magenta
Color.from_hex(0xff00ff)
.. code-block:: python
import color
# Cyan
color.from_hex(0x00ffff)
"""
red
=
(
color
&
0xff0000
)
>>
16
green
=
(
color
&
0x00ff00
)
>>
8
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment