{"id":24829295,"url":"https://github.com/hslarson/ece-5-led-cube","last_synced_at":"2026-04-19T03:02:05.445Z","repository":{"id":176193357,"uuid":"340617646","full_name":"hslarson/ECE-5-LED-Cube","owner":"hslarson","description":"ECE 5 Final Project: A 6x6x6 LED matrix that responds to audio input","archived":false,"fork":false,"pushed_at":"2025-03-23T19:06:28.000Z","size":5942,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T20:20:25.613Z","etag":null,"topics":["arduino","audio-visualizer","led-cube","msgeq7","school-project"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hslarson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-20T09:44:38.000Z","updated_at":"2023-11-21T17:30:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"a9b94587-886f-4d09-991b-e4cfc8da54b5","html_url":"https://github.com/hslarson/ECE-5-LED-Cube","commit_stats":null,"previous_names":["hslarson/ece-5-led-cube"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hslarson%2FECE-5-LED-Cube","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hslarson%2FECE-5-LED-Cube/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hslarson%2FECE-5-LED-Cube/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hslarson%2FECE-5-LED-Cube/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hslarson","download_url":"https://codeload.github.com/hslarson/ECE-5-LED-Cube/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245573837,"owners_count":20637670,"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":["arduino","audio-visualizer","led-cube","msgeq7","school-project"],"created_at":"2025-01-30T23:05:07.730Z","updated_at":"2025-10-16T16:48:26.937Z","avatar_url":"https://github.com/hslarson.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿[![Cube GIF](https://i.ibb.co/CWw726G/IMG-7925.gif)](https://photos.app.goo.gl/J5VMb96Lni4Fbc2d9 \"More Images\")\n\n\u003chr /\u003e\n\n### Main Program:\n\n- \u003cb\u003e loop \u003c/b\u003e\n  - Calls the nextLayer() member  function of the Multiplexer class on a preset interval\n  - While we wait for the next layer to be drawn, the loop calls the subtasks() function to perform several smaller tasks required to draw the matrix\n- \u003cb\u003esubtasks\u003c/b\u003e\n  - Each subtask referenced in this function is called once for every complete matrix that is sent to the cube. The function must be reset after every iteration\n  - The first step (case 0) is calling the checkVolume() member function of the MSGEQ7 class, this decides whether the subtasks function draws a volume matrix or a spectrum matrix\n  - Next, we collect the data required to construct the matrix. This is only required if we are drawing a spectrum matrix\n  - Then, we construct the matrix itself. This is handled entirely by the respective classes\n  - Lastly, we queue the matrix we just drew, meaning that it will be shown in the next iteration of the loop\n\n### Multiplexer Class:\n\n- \u003cb\u003esetMatrix\u003c/b\u003e\n  - Uses memcpy to either queue a new matrix or allow the queued matrix to be shown\n- \u003cb\u003enextLayer\u003c/b\u003e\n  - Handles the drawing of individual layers and the queuing of matrices\n  - First, calls the constructData() function to format the data in a way that the registers will understand\n  - Then, calls the sendData() function to send the data to the cube\n- \u003cb\u003econstructData\u003c/b\u003e\n  - A helper function for nextLayer() that handles the mapping of output pins and the conversion of the resultant binary array to an integer array\n- \u003cb\u003esendToCube\u003c/b\u003e\n  - Uses the SPI bus to send the data from the constructData() function to the shift registers\n\n### MSGEQ7 Class:\n\n- \u003cb\u003egetSpectrum\u003c/b\u003e\n  - Reads data from the MSGEQ7 breakout board using analogRead()\n- \u003cb\u003enormSpectrum\u003c/b\u003e\n  - Takes the array from the getSpectrum() function and converts from 7 channels to 36\n- \u003cb\u003emakeSpectrumMatrix\u003c/b\u003e\n  - Maps each frequency band to a specific column of the cube\n  - Applies a threshold to the raw reading to decide how many LED’s to light in each column and constructs a Boolean matrix based on this data\n- \u003cb\u003equeueMatrix\u003c/b\u003e\n  - Calls the setMatrix() member of the Multiplexer class to queue the matrix that was built by the makeSpectrumMatrix() function\n\n### VolumeControl Class:\n\n- \u003cb\u003echeckVolume\u003c/b\u003e\n  - Uses a timer and the getVolume() function to decide whether or not to draw a volume matrix\n- \u003cb\u003egetVolume\u003c/b\u003e\n  - Reads data from the volume potentiometer and normalizes the reading\n  - Creates a running average of the normalized readings\n- \u003cb\u003emakeVolumeMatrix\u003c/b\u003e\n  - Takes the current volume reading and creates a Boolean matrix that displays the volume as front-to-back bars that ascend each column then move from left to right to the next column\n- \u003cb\u003equeueMatrix\u003c/b\u003e\n  - Takes the matrix that was constructed by the makeVolumeMatrix and queues it to be shown on the cube\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhslarson%2Fece-5-led-cube","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhslarson%2Fece-5-led-cube","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhslarson%2Fece-5-led-cube/lists"}