{"id":24641009,"url":"https://github.com/kkestell/sechzig","last_synced_at":"2025-03-20T11:48:49.757Z","repository":{"id":273077752,"uuid":"917886118","full_name":"kkestell/sechzig","owner":"kkestell","description":"Lua-scripted NeoPixel LED animations","archived":false,"fork":false,"pushed_at":"2025-01-18T13:35:54.000Z","size":364,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-18T14:53:35.698Z","etag":null,"topics":["esp32","lua","neopixel","toy"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kkestell.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-16T20:36:36.000Z","updated_at":"2025-01-18T13:35:55.000Z","dependencies_parsed_at":"2025-01-18T14:53:41.193Z","dependency_job_id":"c630d042-87e9-4bca-a4f3-27d90277abf8","html_url":"https://github.com/kkestell/sechzig","commit_stats":null,"previous_names":["kkestell/sechzig"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkestell%2Fsechzig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkestell%2Fsechzig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkestell%2Fsechzig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkestell%2Fsechzig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kkestell","download_url":"https://codeload.github.com/kkestell/sechzig/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244609437,"owners_count":20480782,"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":["esp32","lua","neopixel","toy"],"created_at":"2025-01-25T12:11:59.903Z","updated_at":"2025-03-20T11:48:49.730Z","avatar_url":"https://github.com/kkestell.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sechzig\n\nLua-scripted NeoPixel LED animations.\n\n\u003e Please keep still and only watchen astaunished the blinkenlights.\n\n## How it Works\n\nThe ESP32 is connected to a 60-LED NeoPixel ring. The ESP32 runs a Lua interpreter that executes animation scripts to control the LEDs. It cycles through the animations, looping each animation for one minute before moving on to the next one.\n\nThe ESP32 creates a public Wi-Fi access point that hosts a web server. Users can connect to the access point and create and modify their own Lua scripts to create custom animations. The scripts are stored on a LittleFS file system on the ESP32's internal flash memory.\n\nThe NeoPixel ring is epoxied to a piece of hardboard that is painted flat black and mounted in a poplar wood frame. The frame fits into the back of a cheap picture frame. The frame's glass is covered with a layer of tinted film for added effect.\n\n## Writing Your Own Animations\n\nFirst, connect to the \"Sechzig\" Wi-Fi network. Visit [http://192.168.4.1](http://192.168.4.1) in your web browser to access the web interface.\n\n### Structure of an Animation Script\n\nEach animation script must define a function called `tick(dt)`. This function is called repeatedly to update the animation on each frame.\n\n* `dt` (float): The time in seconds since the last frame.\n\n### Example Script\n\n```lua\nfunction tick(dt)\n  gradient(0, NUM_PIXELS-1, 255, 0, 0, 0, 0, 255)\nend\n```\n\n## Lua Helper Functions\n\n### Pixel Control\n\n#### `setPixel(pixel, r, g, b)`\n\nSets the color of a specific pixel.\n\n* `pixel` (int): Index of the pixel (0 to NUM_PIXELS-1).\n* `r`, `g`, `b` (int): Red, green, and blue values (0-255).\n\n#### `getPixel(pixel)`\n\nGets the RGB values of a specific pixel.\n\n* `pixel` (int): Index of the pixel (0 to NUM_PIXELS-1).\n* **Returns**: `r`, `g`, `b` (int): Red, green, and blue values.\n\n#### `fillRange(start, end, r, g, b)`\n\nFills a range of pixels with a specific color.\n\n* `start`, `end` (int): Start and end indices of the range.\n* `r`, `g`, `b` (int): Red, green, and blue values (0-255).\n\n#### `clear()`\n\nClears all pixels (sets them to off).\n\n#### `setBrightness(brightness)`\n\nSets the global brightness for all pixels.\n\n* `brightness` (int): Brightness level (0-255).\n\n#### `shiftPixels(amount, wrap)`\n\nShifts all pixels by a specified amount.\n\n* `amount` (int): Number of pixels to shift (positive or negative).\n* `wrap` (bool): Whether to wrap pixels around the edges.\n\n### Color Manipulation\n\n#### `blend(r1, g1, b1, r2, g2, b2, ratio)`\n\nBlends two colors together.\n\n* `r1, g1, b1` (int): First color.\n* `r2, g2, b2` (int): Second color.\n* `ratio` (float): Blend ratio (0.0 = full first color, 1.0 = full second color).\n* **Returns**: `r`, `g`, `b` (int): Blended color.\n\n#### `hsv2rgb(h, s, v)`\n\nConverts HSV color to RGB.\n\n* `h` (float): Hue (0-360).\n* `s` (float): Saturation (0.0-1.0).\n* `v` (float): Value (0.0-1.0).\n* **Returns**: `r`, `g`, `b` (int): RGB values.\n\n#### `gradient(start, end, r1, g1, b1, r2, g2, b2)`\n\nCreates a gradient between two colors across a range of pixels.\n\n* `start`, `end` (int): Start and end indices of the range.\n* `r1, `g1, `b1` (int): Start color.\n* `r2, `g2, `b2` (int): End color.\n\n### Math and Utilities\n\n#### `qsub8(i, j)`\n\nSubtracts two integers, clamping the result to 0.\n\n* `i`, `j` (int): Input integers.\n* **Returns**: Clamped result (int).\n\n#### `qadd8(i, j)`\n\nAdds two integers, clamping the result to 255.\n\n* `i`, `j` (int): Input integers.\n* **Returns**: Clamped result (int).\n\n#### `scale8(i, scale)`\n\nScales an integer by a factor (0-255).\n\n* `i` (int): Input integer.\n* `scale` (int): Scale factor.\n* **Returns**: Scaled result (int).\n\n#### `map(x, in_min, in_max, out_min, out_max)`\n\nMaps a number from one range to another.\n\n* `x` (float): Input value.\n* `in_min`, `in_max` (float): Input range.\n* `out_min`, `out_max` (float): Output range.\n* **Returns**: Mapped value (float).\n\n#### `random(min, max)`\n\nGenerates a random integer in a specified range.\n\n* `min`, `max` (int): Range.\n* **Returns**: Random integer.\n\n#### `millis()`\n\nGets the number of milliseconds since the program started.\n\n* **Returns**: Milliseconds (int).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkkestell%2Fsechzig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkkestell%2Fsechzig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkkestell%2Fsechzig/lists"}