Skip to content
Browse files

dim mode

  • Loading branch information...
1 parent bf78c5d commit a57a09c4df6cfa2328081bba961773468160237a @osresearch committed Jan 1, 2000
Showing with 5 additions and 4 deletions.
  1. +5 −4 matrix-test.c
View
9 matrix-test.c
@@ -98,16 +98,17 @@ rainbow(
)
{
const unsigned color = cycle % 180;
+ const unsigned dim = 8;
for (unsigned x=0; x < width; x++) {
for (unsigned y=0; y < height; y++) {
const int index = (color + x + y*phaseShift/4) % 180;
const uint32_t in = rainbowColors[index];
uint8_t * const out = &pixels[x + y*width];
#if 1
- out[0] = ((in >> 0) & 0xFF); // * y / 16;
- out[1] = ((in >> 8) & 0xFF); // * y / 16;
- out[2] = ((in >> 16) & 0xFF); // * y / 16;
+ out[0] = ((in >> 0) & 0xFF) * dim / 128; // * y / 16;
+ out[1] = ((in >> 8) & 0xFF) * dim / 128; // * y / 16;
+ out[2] = ((in >> 16) & 0xFF) * dim / 128; // * y / 16;
#else
//out[0] = ((in >> 0) & 0xFF);
//out[1] = ((in >> 8) & 0xFF);
@@ -152,7 +153,7 @@ gradient(
int
main(void)
{
- const int width = 64;
+ const int width = 128;
const int height = 48;
ledscape_t * const leds = ledscape_init(width, height);
printf("init done\n");

0 comments on commit a57a09c

Please sign in to comment.
Something went wrong with that request. Please try again.