{"id":16219916,"url":"https://github.com/yveaux/ledpattern","last_synced_at":"2025-03-19T11:30:47.533Z","repository":{"id":82612028,"uuid":"102974148","full_name":"Yveaux/LedPattern","owner":"Yveaux","description":"Arduino library to run set-and-forget LED blink patterns","archived":false,"fork":false,"pushed_at":"2018-02-09T14:08:06.000Z","size":23,"stargazers_count":14,"open_issues_count":1,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-28T18:23:03.553Z","etag":null,"topics":["arduino","arduino-library","fastled","led","led-controlling","neopixel","ws2812b"],"latest_commit_sha":null,"homepage":"","language":"C++","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/Yveaux.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":"2017-09-09T17:50:56.000Z","updated_at":"2024-12-30T13:00:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"de984a1d-8d2b-4096-96bb-0a383baf6398","html_url":"https://github.com/Yveaux/LedPattern","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/Yveaux%2FLedPattern","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yveaux%2FLedPattern/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yveaux%2FLedPattern/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yveaux%2FLedPattern/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yveaux","download_url":"https://codeload.github.com/Yveaux/LedPattern/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243985813,"owners_count":20379210,"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","arduino-library","fastled","led","led-controlling","neopixel","ws2812b"],"created_at":"2024-10-10T11:56:30.427Z","updated_at":"2025-03-19T11:30:47.527Z","avatar_url":"https://github.com/Yveaux.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LedPattern\nThis library allows you to define complex LED blink \u0026 fade patterns and execute them calling a simple update() method at regular intervals.\nYou no longer have to worry about timing, fading and counting.\n\nIt can be used to control regular on/off LEDs, fadeable LEDs connected to PWM pins or RGB LEDs like NeoPixel or WS2812B.\n\nA very basic example will switch a LED on/off at regular intervals:\n\n```\n#include \"LedPattern_Mono.h\" \n\n// Define Led ON/OFF symbolic names \n#define LED_ON  (255)\n#define LED_OFF (0) \n\n// Define the pattern: A repeating sequence of switching the LED on\n// for 50 cycles, then off for 100 cycles.\nconst uint8_t myPattern[] = {\n    LedPattern::CMD_REPEAT, LedPattern::repeatForever, \n        LedPattern::CMD_SET, LED_ON,\n        LedPattern::CMD_WAIT, 50,\n        LedPattern::CMD_SET, LED_OFF,\n        LedPattern::CMD_WAIT, 100,\n    LedPattern::CMD_ENDREPEAT\n};\n\n// Define the LED pin (pin 6 supports PWM, thus fading is supported)\n#define LED_PIN (6)\n\n// Create the Led pattern handling class.\nstatic LedPattern_Mono pattern(LED_PIN);\n\nvoid setup()\n{\n  // Start playing the pattern\n  pattern.start(myPattern);\n}\n\nvoid loop()\n{\n  // Update pattern state. LED gets updated and the pattern gets parsed.\n  pattern.update();\n  \n  // Wait 1 time (10ms) cycle before updating again.\n  delay(10);\n}\n```\n\nIt's just as easy to fade the LED between on and off (must be a pin supporting PWM!):\n\n```\n// Define the pattern: A repeating sequence of fading the LED to on\n// in 50 cycles, then fading back to off in 100 cycles.\nconst uint8_t myPattern[] = {\n    LedPattern::CMD_SET, OFF,\n    LedPattern::CMD_REPEAT, LedPattern::repeatForever, \n        LedPattern::CMD_FADETO,  50, LED_ON,\n        LedPattern::CMD_FADETO, 100, LED_OFF,\n    LedPattern::CMD_ENDREPEAT\n};\n```\n\nOr blink 5 times, followed by a pause (nice to blink error codes or states!)\n\n```\n// Define the pattern: A repeating sequence of fading the LED to on\n// in 50 cycles, then fading back to off in 100 cycles.\nconst uint8_t myPattern[] = {\n    LedPattern::CMD_SET, OFF,\n    LedPattern::CMD_REPEAT, LedPattern::repeatForever, \n         LedPattern::CMD_REPEAT, 5, \n             LedPattern::CMD_SET, LED_ON,\n             LedPattern::CMD_WAIT, 50,\n             LedPattern::CMD_SET, LED_OFF,\n             LedPattern::CMD_WAIT, 100,\n         LedPattern::CMD_ENDREPEAT\n         LedPattern::CMD_WAIT, 200,\n    LedPattern::CMD_ENDREPEAT\n};\n```\n\nHave a look at the examples for more complex and RGB LED examples!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyveaux%2Fledpattern","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyveaux%2Fledpattern","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyveaux%2Fledpattern/lists"}