Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas committed May 9, 2019
1 parent 34757af commit fd03702
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 17 deletions.
5 changes: 0 additions & 5 deletions a1_single_pixel/a1_single_pixel.ino
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,13 @@ SMARTMATRIX_ALLOCATE_BUFFERS(matrix, TOTAL_WIDTH, TOTAL_HEIGHT, kRefreshDepth, k
SMARTMATRIX_ALLOCATE_BACKGROUND_LAYER(bg, TOTAL_WIDTH, TOTAL_HEIGHT, COLOR_DEPTH, kbgOptions);

void setup() {

bg.enableColorCorrection(false); // bg is the "background" layer
matrix.addLayer(&bg);
matrix.setBrightness(255);
matrix.begin();

}


void loop() {

bg.fillScreen({0, 0, 0}); // Clear to a color {r,g,b}

bg.drawPixel(10, 10, {255, 0, 0}); // Draw some red pixels
Expand All @@ -45,5 +41,4 @@ void loop() {
bg.drawPixel(12, 12, {255, 0, 0});

bg.swapBuffers(); // The library offers double buffering

}
4 changes: 0 additions & 4 deletions a2_single_pixel_animated/a2_single_pixel_animated.ino
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,14 @@ SMARTMATRIX_ALLOCATE_BUFFERS(matrix, TOTAL_WIDTH, TOTAL_HEIGHT, kRefreshDepth, k
SMARTMATRIX_ALLOCATE_BACKGROUND_LAYER(bg, TOTAL_WIDTH, TOTAL_HEIGHT, COLOR_DEPTH, kbgOptions);

void setup() {

pinMode(LED_BUILTIN, OUTPUT);

bg.enableColorCorrection(false); // bg is the "background" layer
matrix.addLayer(&bg);
matrix.setBrightness(255);
matrix.begin();

}



void loop() {
static uint32_t count = 0; // Just a counter
static uint8_t offs_y = TOTAL_HEIGHT / 2;
Expand Down
11 changes: 3 additions & 8 deletions a3_serial_rgb_slave/a3_serial_rgb_slave.ino
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,21 @@ SMARTMATRIX_ALLOCATE_BUFFERS(matrix, TOTAL_WIDTH, TOTAL_HEIGHT, kRefreshDepth, k
SMARTMATRIX_ALLOCATE_BACKGROUND_LAYER(bg, TOTAL_WIDTH, TOTAL_HEIGHT, COLOR_DEPTH, kbgOptions);

void setup() {

Serial.setTimeout(50);

pinMode(LED_BUILTIN, OUTPUT);

Serial.setTimeout(50);

bg.enableColorCorrection(colorCorrectionEnabled);
matrix.setBrightness(brightnessValue);
matrix.addLayer(&bg);
matrix.begin();

}


void loop() {

static uint32_t count = 0;

char chr = Serial.read();

if (chr == '*') { // Incoming data
// masterFrame
uint16_t count = Serial.readBytes((char *)buf, BUFFER_SIZE);
Expand All @@ -74,7 +70,7 @@ void loop() {
bg.swapBuffers(swapBuffersEnabled);
}
} else if (chr == '?') { // Write out some (parseable) info
Serial.print("MAT,"); //
Serial.print("MAT,");
Serial.print(MATRIX_WIDTH);
Serial.print(',');
Serial.print(MATRIX_HEIGHT);
Expand All @@ -101,5 +97,4 @@ void loop() {

digitalWrite(LED_BUILTIN, count / 10 % 2); // Let's animate the built-in LED as well
count++;

}

0 comments on commit fd03702

Please sign in to comment.