Skip to content

Commit 2c3025d

Browse files
authored
Merge pull request #10 from rhooper/more-magic
Add more animations, add AggregatePixels helper.
2 parents b4cab15 + fa69348 commit 2c3025d

14 files changed

+1603
-371
lines changed

LICENSE

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
The MIT License (MIT)
22

33
Copyright (c) 2017 Adam Patt
4+
Copyright (c) 2019-2020 Roy Hooper, Kattni Rembor
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy
67
of this software and associated documentation files (the "Software"), to deal

adafruit_led_animation/__init__.py

+46-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,49 @@
1+
# The MIT License (MIT)
2+
#
3+
# Copyright (c) 2020 Roy Hooper
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files (the "Software"), to deal
7+
# in the Software without restriction, including without limitation the rights
8+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
# copies of the Software, and to permit persons to whom the Software is
10+
# furnished to do so, subject to the following conditions:
11+
#
12+
# The above copyright notice and this permission notice shall be included in
13+
# all copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
# THE SOFTWARE.
122
"""
2-
Adafruit LED Animation library.
23+
Timing for Adafruit LED Animation library.
24+
25+
Author(s): Roy Hooper
326
"""
427

5-
NANOS_PER_SECOND = 1000000000
28+
try:
29+
from micropython import const
30+
except ImportError:
31+
32+
def const(value): # pylint: disable=missing-docstring
33+
return value
34+
35+
36+
try:
37+
from time import monotonic_ns
38+
except ImportError:
39+
import time
40+
41+
def monotonic_ns():
42+
"""
43+
Implementation of monotonic_ns for platforms without time.monotonic_ns
44+
"""
45+
return int(time.time() * NANOS_PER_SECOND)
46+
47+
48+
NANOS_PER_SECOND = const(1000000000)
49+
NANOS_PER_MS = const(1000000)

0 commit comments

Comments
 (0)