This patch reduces the code size and improves the CPU performance of
Charliplexing.cpp by:
* removing zeroed data in videoPage
* precalculating information for LedSign::Set()
* removing unneeded register writes in TIMER2_OVF_vect()
* using a roving pointer to access the display buffer rather than recalculating the array index each time
* eliminating the extra blank interval (1/8 display cycles)
* eliminating an extra display “cycle” (which could also display garbage)
Also fixed several bugs in LedSign::SetBrightness(), which caused weird
grayscale gradiations and reduced brightness by not using a 100% duty cycle
for the maximum setting.
The remote control command line application resided in
parallel to all the other LoLShield sketches but is
actually not a sketch but a Linux application. This change
moves the tool into a subdirectory below the lolcomm
sketch.
Signed-off-by: Thilo Fromm <kontakt@thilo-fromm.de>
LoLcomm is an example application which enables you to set individual
LEDS, or set the whole shield via the serial port. You can also pulse
the shield, or pulse individual LEDs (using grayscale).
I also provide a Linux command line tool for remote-controlling the
LED shield.
This enables you to play around with LED patters and even to script
your shield.
Have fun!
Signed-off-by: Thilo Fromm <kontakt@thilo-fromm.de>
This patch enhances the grayscale work by Matt Mets.
-----------------------------------------------------
THESE CHANGES NEED REVIEW. PLEASE REVIEW THE CHANGES.
-----------------------------------------------------
We now support a total of 8 different shades (including black / OFF)
by solely relying on the high resolution timer.
PLEASE REVIEW these changes made to Charlieplexing.cpp.
COLORS has been renamed to SHADES.
BIT_DEPTH has been removed; SHADES can be set directly.
A FADE example based on Matt's has been added and extended
to allow for "performance tests".
BasicTest has been extended to use double buffering. Since the buffer
is redrawn in a loop it uses synchronized buffer flip.
A new mini-example "Breathe" has been added. "Breathe" simply fades
all the LEDs from off to on and back to off again, not unlike the
power LEDs of some laptop brands when the laptop is in suspend.
"Breathe" can be used to fine-tune the brightness of the individual
shades. Currently the transitions feel far from fluent; I think we
could do better.
Signed-off-by: Thilo Fromm <kontakt@thilo-fromm.de>
See LoLShield issue tracker
(http://code.google.com/p/lolshield/issues/detail?id=19):
This patch adds grayscale to the basic LoLShield test.
The test will run three times, increasing the brightness
of the LEDs in each run, then start all over again.
The frame delay has been reduced to a third of
its initial value so the overall runtime of the test
stays the same.
Signed-off-by: Thilo Fromm <kontakt@thilo-fromm.de>
From the LoLShield issue tracker
(http://code.google.com/p/lolshield/issues/detail?id=18):
What steps will reproduce the problem?
1. Run BasicTest with lolshield 0.2 release, watch LEDs.
2. Run BasicTest with latest lolshield svn, watch LEDs.
What is the expected output? What do you see instead?
Expected: Steady LED lights when they are switched on, like they
did in lolshield-0.2 release.
Instead: LEDs flicker annoyingly.
Wow, this one is NASTY! SetBrightness() is called way too early
during init(), at a time where backTimer* has not been initialised.
Since SetBrightness() writes to places where backTimer* is pointing
the function will write into raw memory *somewhere*, problably into
code being executed.
Signed-off-by: Thilo Fromm <kontakt@thilo-fromm.de>
This patch makes the LoLShield sources compile with Arduino 1.0
From the LoLShield issue tracker: (http://code.google.com/p/lolshield/issues/detail?id=17):
What steps will reproduce the problem?
1. Start up Arduino dev GUI
2. In the GUI load the "LoLShield BasicTest" example:
File -> Examples -> LoLShield -> LoLShield_BasicTest
3. Press the compile button
What is the expected output? What do you see instead?
Expected: compilation works.
Instead:
libraries/LOLshield/Charliplexing.cpp:32:22: fatal error: WProgram.h: No such file or directory
What version of the product are you using? On what operating system?
- Latest Arduino GIT (git://github.com/arduino/Arduino.git), rev. 11281ec77ece61aeab64d047ed899d47221dd4a7, 2012-01-05
- latest lolshield SVN, rev 19
Please provide any additional information below.
This is a known bug w/ lolshield code and Arduino 1.0 or newer. Seemingly Jimmie keeps fixing this every time he
encounters the problem in one of his workshops so I thought patching the actual source in the repository would be more convenient ;)
This patch has been tested on ARDUINO 1.0 ONLY!
Signed-off-by: Thilo Fromm <kontakt@thilo-fromm.de>
- Backwards compatibility mode for b&w should take fewer cycles
- Brightness doesn't get dark enough (minimum timer length issues)
- Only Atmega328 is probably going to work (timing not determined by clock speed)