Skip to content

Commit

Permalink
updated for Processing v3
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalcoleman committed Dec 2, 2015
1 parent e93f3c9 commit 773252a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
13 changes: 6 additions & 7 deletions neo_pixel_sequencer/ColorMatrix.pde
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class ColorMatrix extends Matrix {
super(cp5, theName);

setView(new ControllerView() {
void display(PApplet p, Object b) {
void display(PGraphics p, Object b) {
p.noStroke();
p.fill(bkg);
p.rect(0, 0, width, height);
Expand All @@ -22,8 +22,8 @@ class ColorMatrix extends Matrix {
}
}
if (isInside()) {
int x = (int) ((p.mouseX - position.x) / stepX);
int y = (int) ((p.mouseY - position.y) / stepY);
int x = (int) ((mouseX - getPosition()[0]) / stepX);
int y = (int) ((mouseY - getPosition()[1]) / stepY);
if (x >= 0 && x < _myCellX && y >= 0 && y < _myCellY) {
p.fill(_myCells[x][y] == 1 ? -0.2 : -0.5);
p.rect(x * stepX, y * stepY, stepX - gapX, stepY - gapY);
Expand All @@ -40,8 +40,8 @@ class ColorMatrix extends Matrix {
_myCellX = theCellX;
_myCellY = theCellY;
sum = _myCellX * _myCellY;
stepX = width / _myCellX;
stepY = height / _myCellY;
stepX = getWidth() / _myCellX;
stepY = getHeight() / _myCellY;
_myCells = new int[_myCellX][_myCellY];
_myCellColor = new int[_myCellX][_myCellY];
for (int x = 0; x < _myCellX; x++) {
Expand Down Expand Up @@ -83,5 +83,4 @@ class ColorMatrix extends Matrix {
}
return this;
}
}

}
3 changes: 1 addition & 2 deletions neo_pixel_sequencer/neo_pixel_sequencer.pde
Original file line number Diff line number Diff line change
Expand Up @@ -235,5 +235,4 @@ void Number_of_LEDs(int newled) {
slice = PI/NUMBER_OF_LED;
cp5.get(ColorMatrix.class, "LED_sequence").setGrid(SEQUENCE_LENGTH, NUMBER_OF_LED);
}
}

}

0 comments on commit 773252a

Please sign in to comment.