{"id":23500463,"url":"https://github.com/techninja/mosaic-screen","last_synced_at":"2025-04-25T08:58:51.584Z","repository":{"id":47383052,"uuid":"214335797","full_name":"techninja/mosaic-screen","owner":"techninja","description":"A single day hack app to stream at ~30-60fps to a Adafruit Neopixel display","archived":false,"fork":false,"pushed_at":"2022-12-11T09:00:28.000Z","size":150,"stargazers_count":2,"open_issues_count":8,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-16T16:25:30.000Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/techninja.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-11T03:30:17.000Z","updated_at":"2019-11-04T00:21:41.000Z","dependencies_parsed_at":"2023-01-26T19:35:11.304Z","dependency_job_id":null,"html_url":"https://github.com/techninja/mosaic-screen","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techninja%2Fmosaic-screen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techninja%2Fmosaic-screen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techninja%2Fmosaic-screen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techninja%2Fmosaic-screen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/techninja","download_url":"https://codeload.github.com/techninja/mosaic-screen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250573347,"owners_count":21452345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-25T06:44:21.579Z","updated_at":"2025-04-24T05:53:18.550Z","avatar_url":"https://github.com/techninja.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mosaic-screen\nA single day hack app to stream at ~30-60fps to a Adafruit Neopixel display\n\nYup, just like it says. Made this with my son Dorian in a day or so. Code\nquality is terrible, but very performant.\n\nArduino interfaces directly with the Neopixel strip, and simply reads bytes in\nand sets values in order. Here's the Arduino code (though I'm running it on a\nTeensy, still works great):\n\n```c++\n// Simple byte based linear stream for FAST 256* color display.\n#include \u003cAdafruit_NeoPixel.h\u003e\n#ifdef __AVR__\n #include \u003cavr/power.h\u003e // Required for 16 MHz Adafruit Trinket\n#endif\n\n// Which pin on the Arduino is connected to the NeoPixels?\n#define LED_PIN    0\n\n// How many NeoPixels are attached to the Arduino?\n#define LED_COUNT 225\n\nint pixel = 0;\nint counter = 0;\nint bright = 125;\n\n// Declare our NeoPixel strip object:\nAdafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);\n\n// setup() function -- runs once at startup --------------------------------\nvoid setup() {\n  // These lines are specifically to support the Adafruit Trinket 5V 16 MHz.\n  // Any other board, you can remove this part (but no harm leaving it):\n#if defined(__AVR_ATtiny85__) \u0026\u0026 (F_CPU == 16000000)\n  clock_prescale_set(clock_div_1);\n#endif\n  // END of Trinket-specific code.\n  Serial.begin(115200);\n  strip.begin();           // INITIALIZE NeoPixel strip object (REQUIRED)\n  strip.show();            // Turn OFF all pixels ASAP\n  strip.setBrightness(bright); // Set BRIGHTNESS\n}\n\n\n// loop() function -- runs repeatedly as long as board is on ---------------\n\nvoid loop() {\n  // 1. Read a byte through the serial port\n  // 2. If it's a trigger byte, run strip show and reset counter\n  // 3. Otherwise, read what color the byte is, and set the counter pixel\n  while (Serial.available()) {\n    pixel = Serial.read();\n    if (pixel == 255) {\n      // New frame! Display the last one, reset counter.\n      strip.show();\n      counter = 0;\n    } else {\n      uint32_t color = strip.Color((pixel \u003e\u003e 5) * 32, ((pixel \u0026 28) \u003e\u003e 2) * 32, (pixel \u0026 3) * 64, bright);\n      strip.setPixelColor(counter, color);\n      counter++;\n\n      // Sane byte overflow protection.\n      if (counter \u003e strip.numPixels() - 1) {\n        counter = 0;\n      }\n    }\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechninja%2Fmosaic-screen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechninja%2Fmosaic-screen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechninja%2Fmosaic-screen/lists"}