Skip to content

Commit

Permalink
Fix X/Y clipping on CharlieWing
Browse files Browse the repository at this point in the history
  • Loading branch information
PaintYourDragon committed Dec 6, 2016
1 parent 8b0fb99 commit 20153fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions Adafruit_IS31FL3731.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,8 @@ void Adafruit_IS31FL3731_Wing::drawPixel(int16_t x, int16_t y, uint16_t color) {
break;
}

// charlie wing is smaller
//if (x > 15) return;
//if (y > 7) return;
// charlie wing is smaller:
if ((x < 0) || (x >= 16) || (y < 0) || (y >= 7)) return;

if (x > 7) {
x=15-x;
Expand All @@ -98,10 +97,7 @@ void Adafruit_IS31FL3731_Wing::drawPixel(int16_t x, int16_t y, uint16_t color) {
}

_swap_int16_t(x, y);


if ((x < 0) || (x >= 16)) return;
if ((y < 0) || (y >= 9)) return;
if (color > 255) color = 255; // PWM 8bit max

setLEDPWM(x + y*16, color, _frame);
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Adafruit IS31FL3731 Library
version=1.0.0
version=1.0.1
author=Adafruit
maintainer=Adafruit <[email protected]>
sentence=Arduino library for the Adafruit IS31FL3731 Charlieplex LED driver and CharliePlex FeatherWing.
Expand Down

0 comments on commit 20153fc

Please sign in to comment.