Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
44f936a
merge functionality of Adafruit_NeoMatrix
Jorgen-VikingGod Apr 29, 2016
ccc3ba7
add new examples
Jorgen-VikingGod Apr 29, 2016
e545ceb
typo
Jorgen-VikingGod Apr 29, 2016
82bd3e7
typo
Jorgen-VikingGod Apr 29, 2016
f1863a0
add release and dependencies badge icons
Jorgen-VikingGod May 2, 2016
784b4c5
version badge
Jorgen-VikingGod May 2, 2016
527cbe8
add travis script
Jorgen-VikingGod May 3, 2016
12e5930
initialize travis file
Jorgen-VikingGod May 3, 2016
170eba6
typo
Jorgen-VikingGod May 3, 2016
0b660d8
typo
Jorgen-VikingGod May 3, 2016
64f800d
typo
Jorgen-VikingGod May 3, 2016
91b9283
typo
Jorgen-VikingGod May 3, 2016
c6f7ccd
obsolete
Jorgen-VikingGod May 3, 2016
00241f7
add travis build badge
Jorgen-VikingGod May 3, 2016
4cfcc4d
change verion badge
Jorgen-VikingGod May 3, 2016
aa0429c
change travis badge
Jorgen-VikingGod May 3, 2016
fd59746
update to new modifications
Jorgen-VikingGod Nov 18, 2016
a3ed164
update FastLED initial
Jorgen-VikingGod Nov 18, 2016
044df7a
update defines, examples and methods
Jorgen-VikingGod Nov 18, 2016
fbf9914
Update MatrixTilesExample.ino
Jorgen-VikingGod Nov 18, 2016
1b3fc12
Update .travis.yml
Jorgen-VikingGod Nov 18, 2016
a533c51
change pin to ESP8266 generic
Jorgen-VikingGod Nov 18, 2016
bc37fd5
change pins to ESP8266 generic
Jorgen-VikingGod Nov 18, 2016
b034fd6
Update MatrixTilesExample.ino
Jorgen-VikingGod Nov 18, 2016
09813ec
Update MatrixExample1.ino
Jorgen-VikingGod Nov 18, 2016
155dc6f
update github link on includes
Jorgen-VikingGod Nov 18, 2016
e1964ff
Update README.md
Jorgen-VikingGod Nov 18, 2016
3e52692
Update README.md
marcmerlin Apr 30, 2018
9bbfa0f
Fix division by 0 on single point draw, add DrawPixel.
marcmerlin May 4, 2018
32ee1e2
Fix division by 0 on single point draw, add DrawPixel.
marcmerlin May 4, 2018
28dd204
Merge branch 'master' of github.com:marcmerlin/LEDMatrix
marcmerlin May 4, 2018
fbcbd53
Improve documentation to show reversed order
marcmerlin May 4, 2018
c4f86df
Merge pull request #3 from marcmerlin/patch-2
Jorgen-VikingGod May 6, 2018
6136b6c
Merge pull request #2 from marcmerlin/master
Jorgen-VikingGod Aug 15, 2018
fdf2cf3
Added pointer to SmartMatrix::GFX to run LEDMatrix code on RGB Panels
marcmerlin Jan 3, 2019
b3e85e1
Merge pull request #4 from marcmerlin/patch-2
Jorgen-VikingGod Jan 15, 2019
715bcfc
Added support for using an externally allocated memory array.
marcmerlin Apr 7, 2019
a11e74c
Merge pull request #5 from marcmerlin/ledmalloc
Jorgen-VikingGod Apr 14, 2019
98eff9b
Merge pull request #1 from marcmerlin/patch-1
Jorgen-VikingGod Apr 14, 2019
45e8668
Support Matrices with more than 32K pixels.
marcmerlin Jan 26, 2020
e6d5e1f
Merge pull request #6 from MarcFork/master
Jorgen-VikingGod Jan 26, 2020
4a668d2
More info on how to run/debug LEDMatrix code on linux
marcmerlin Jan 27, 2020
4494473
Merge pull request #7 from marcmerlin/patch-1
Jorgen-VikingGod Jan 27, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
language: c
before_install:
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16"
- sleep 3
- export DISPLAY=:1.0
- wget http://downloads.arduino.cc/arduino-1.6.5-linux64.tar.xz
- tar xf arduino-1.6.5-linux64.tar.xz
- sudo mv arduino-1.6.5 /usr/local/share/arduino
- sudo ln -s /usr/local/share/arduino/arduino /usr/local/bin/arduino
install:
- ln -s $PWD /usr/local/share/arduino/libraries/LEDMatrix
# boards manager not working on 1.6.7 - 1.6.8
- arduino --pref "boardsmanager.additional.urls=http://arduino.esp8266.com/stable/package_esp8266com_index.json" --save-prefs
# install lib arduino json not working in 1.6.5
# - arduino --install-library "FastLED"
- git clone https://github.com/FastLED/FastLED /usr/local/share/arduino/libraries/FastLED
- arduino --install-boards esp8266:esp8266
- arduino --board esp8266:esp8266:generic --save-prefs
- arduino --pref "compiler.warning_level=all" --save-prefs
script:
- "echo $PWD"
- "echo $HOME"
- "ls $PWD"
- source $TRAVIS_BUILD_DIR/travis/common.sh
- build_examples
# - "cat $PWD/examples/MatrixExample1/MatrixExample1.ino"
notifications:
email:
on_success: change
on_failure: change
38 changes: 24 additions & 14 deletions LEDMatrix.cpp
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/*
LEDMatrix V4 class by Aaron Liddiment (c) 2015
LEDMatrix V5 class by Aaron Liddiment (c) 2016
modified: Juergen Skrotzky (JorgenVikingGod@gmail.com)
date: 2016/04/27

Inspiration for some of the Matrix functions from Stefan Petrick
Inspiration for some of the Matrix functions from Stefan Petrick

FastLED v3.1 library by Daniel Garcia and Mark Kriegsmann.
Written & tested on a Teensy 3.1 using Arduino V1.6.3 & teensyduino V1.22
FastLED v3.1 library by Daniel Garcia and Mark Kriegsmann.
Written & tested on a Teensy 3.1 using Arduino V1.6.3 & teensyduino V1.22
*/

#include <FastLED.h>
Expand Down Expand Up @@ -143,24 +145,32 @@ void cLEDMatrixBase::QuadrantBottomTriangleMirror()
QuadrantMirror();
}

void cLEDMatrixBase::DrawPixel(int16_t x, int16_t y, CRGB Col) {
DrawLine(x, y, x, y, Col);
}

void cLEDMatrixBase::DrawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, CRGB Col)
{
int16_t dx = x1 - x0;
int16_t dy = y1 - y0;
if (abs(dx) >= abs(dy))
{
int32_t f = ((int32_t)dy << 16) / (int32_t)abs(dx);
int32_t y = ((int32_t)y0 << 16) + 32768;
if (dx >= 0)
{
for (; x0<=x1; ++x0,y+=f)
(*this)(x0, (y >> 16)) = Col;
}
else
{
for (; x0>=x1; --x0,y+=f)
(*this)(x0, (y >> 16)) = Col;
// Support a single dot line without diving by 0 and crashing below
if (!dx) {
(*this)(x0, (y >> 16)) = Col;
} else {
int32_t f = ((int32_t)dy << 16) / (int32_t)abs(dx);
if (dx >= 0)
{
for (; x0<=x1; ++x0,y+=f)
(*this)(x0, (y >> 16)) = Col;
}
else
{
for (; x0>=x1; --x0,y+=f)
(*this)(x0, (y >> 16)) = Col;
}
}
}
else
Expand Down
Loading