-
Notifications
You must be signed in to change notification settings - Fork 23
/
LICENSE.txt
37 lines (29 loc) · 1.61 KB
/
LICENSE.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
RGBmatrixPanel Arduino library for Adafruit 16x32 and 32x32 RGB LED
matrix panels. Pick one up at:
http://www.adafruit.com/products/420
http://www.adafruit.com/products/607
!!! Adapted for Spark Core by Paul Kourany, June 2014 !!!
!!! Requires Adafruit_mfGFX and SparkIntervalTimer libraries by Paul Kourany !!!
This version uses a few tricks to achieve better performance and/or
lower CPU utilization:
- To control LED brightness, traditional PWM is eschewed in favor of
Binary Code Modulation, which operates through a succession of periods
each twice the length of the preceeding one (rather than a direct
linear count a la PWM). It's explained well here:
http://www.batsocks.co.uk/readme/art_bcm_1.htm
I was initially skeptical, but it works exceedingly well in practice!
And this uses considerably fewer CPU cycles than software PWM.
- Although many control pins are software-configurable in the user's
code, a couple things are tied to specific PORT registers. It's just
a lot faster this way -- port lookups take time. Please see the notes
later regarding wiring on "alternative" Arduino boards.
- A tiny bit of inline assembly language is used in the most speed-
critical section. The C++ compiler wasn't making optimal use of the
instruction set in what seemed like an obvious chunk of code. Since
it's only a few short instructions, this loop is also "unrolled" --
each iteration is stated explicitly, not through a control loop.
Written by Limor Fried/Ladyada & Phil Burgess/PaintYourDragon for
Adafruit Industries.
BSD license, all text above must be included in any redistribution.
*/