{"id":20943263,"url":"https://github.com/kotyara12/reled","last_synced_at":"2025-04-22T19:20:39.335Z","repository":{"id":134652871,"uuid":"356276273","full_name":"kotyara12/reLed","owner":"kotyara12","description":"ESP32 library for easy control of one or more LEDs: on / off, flash series, blinking. Switch blinking modes with simple commands. Indication of the device status using one LED (as in car alarms and printers).","archived":false,"fork":false,"pushed_at":"2023-06-02T12:05:13.000Z","size":68,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T18:03:01.438Z","etag":null,"topics":["blink","esp-idf","esp32","led"],"latest_commit_sha":null,"homepage":"https://kotyara12.ru/pubs/iot/led32/","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/kotyara12.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-04-09T13:13:32.000Z","updated_at":"2024-12-14T08:09:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"85cb24a6-082c-4543-a984-f11e0e94f40a","html_url":"https://github.com/kotyara12/reLed","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/kotyara12%2FreLed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kotyara12%2FreLed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kotyara12%2FreLed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kotyara12%2FreLed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kotyara12","download_url":"https://codeload.github.com/kotyara12/reLed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250306601,"owners_count":21408927,"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":["blink","esp-idf","esp32","led"],"created_at":"2024-11-18T23:35:20.881Z","updated_at":"2025-04-22T19:20:39.314Z","avatar_url":"https://github.com/kotyara12.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Library for easy control of one or more LEDs.\n\nSupported modes on / off, flash burst, blinking (uniform or burst). There can be one or several LEDs, each LED has its own FreeRTOS task, or use a \"system\" LED (a task for the system LED will be created automatically).\n\nIt is supported to turn on the LED both by setting the high level and low (depending on the LED connection scheme). In addition, work not only with the GPIO of the microcontroller is supported, but also the control of LEDs through the I2C expansion board of the PCF8574 type using a custom callback function.\n\nIt is possible to forcibly suppress LED flashes for a while (for example, you can turn off the LEDs on devices at night, so as not to interfere with sleep).\n\nThe library extension for the \"system\" LED reLedSys allows the device status to be indicated using a single LED (as in car alarms and printers). In addition, the functions of the system LED can be used in a wide variety of places in the code without having to worry about which pin and how the main LED is connected.\n\nDescription: https://kotyara12.ru/pubs/iot/led32/\n\n\n## USING\n\nTo create a task for controlling an LED, use the ledTaskCreate function:\n\nledQueue_t ledTaskCreate(const int8_t ledGPIO, const bool ledHigh, const char * taskName, ledCustomControl_t customControl);\n\nWhere:\nledGPIO - pin number to which the LED is connected.\nledHigh - true = enabled by setting to GPIO high, false = by setting to GPIO low.\ntaskName is the name of the task, for example \"ledRed\" or \"ledAlarm\".\ncustomControl is a callback function to control addressable LEDs or expansion cards (for example PCF8574). Specify NULL if not required.\n\nThe return value is a pointer to the instance of the queue associated with the running task (not the task!).\n\nAfter that, you can send commands to switch the operating mode to the created queue using the following function:\n\nbool ledTaskSend(ledQueue_t ledQueue, ledMode_t msgMode, uint16_t msgValue1, uint16_t msgValue2, uint16_t msgValue3);\n\nWhere:\nledQueue is a pointer to the queue created in ledTaskCreate (...).\nmsgMode - set operating mode (or command), the list of possible commands see below\nmsgValue1, msgValue2, msgValue3 - passed values. Some commands do not require a value, specify 0 or any other number.\n\n\n## OPERATING MODES / CONTROL COMMANDS\n\n- lmEnable\nLocking and unlocking the LED (for example, suppressing any activity at night)\nFormat: lmEnable \"state\" (ex: \"lmEnable 0\" or \"lmEnable 1\")\n   \n- lmOff\t\t\t\nLED off\nFormat: lmOff (ignore parameters)\n\n- lmOn\t\t\t\nLED on\nFormat: lmOn (ignore parameters)\n\n- lmFlash\nOne or more flashes with a specified duration and interval between flashes\nFormat: lmFlash \"number of flashes\" \"duration of flashes\" \"pause between flashes\"\n(for example \"lmFlash 3 100 500\" or \"lmFlash 1 250 250\")\n\n- lmBlinkOn\nContinuous flashing: uniform or in series of flashes (for example, three flashes - pause, etc.)\nFormat: lmBlinkOn \"number of flashes in a series\" \"period of flashes in a series\" \"pause between series\"\n(for example \"lmBlinkOn 1 500 500\" - uniform or \"lmBlinkOn 3 100 5000\" - in series)\nNote: here you cannot set the duration between flashes in a series, it is taken equal to the duration of the flash itself\n\n- lmBlinkOff  \nDisable blinking (waiting for next command)\nFormat: lmBlinkOff (ignore parameters)\n\n!!! The blinkSet mode is autosave !!!\nIf the lmBlinkOn command was received, and after it any other mode (lmOn / lmFlash) was activated, then after its completion (the lmOff command or the specified number of flashes for lmFlash) the previous lmBlinkOn mode will be automatically restored (until it was canceled by the lmBlinkOff command)\n\n\n## Example command sequence:\n\nlmOn:                 LED is on\n\nlmOff:                LED off\n\nlmFlash 3 100 500:    the LED will blink three times with a duration of 100 ms with a pause between flashes of 500 ms, after which it will go out\n\nlmBlinkOn 2 100 5000: LED starts blinking in a series of 2 flashes with a duration of 100 ms and a pause between bursts of 5000 ms\n\nlmOn:                 LED on, blinking temporarily suspended\n\nlmOff:                return to the last blinking mode (in a series of 2 blinks for 100 ms after 5 seconds)\n\nlmFlash 30 100 500:   the LED will blink 30 times with a duration of 100 ms with a pause between flashes of 500 ms, after which we automatically return to the last blinking mode (in a series of 2 flashes of 100 ms each after 5 seconds)\n\nlmOff:                nothing has changed ;-)\n\nlmBlinkOn 1 500 500:  change of blinking mode - continuous uniform blinking 0.5 s on / 0.5 s off\n\nlmBlinkOff:           disable blinking mode, off\n\n\n## Dependencies:\n  - https://github.com/kotyara12/rLog\n\n### Notes:\n  - libraries starting with the \u003cb\u003ere\u003c/b\u003e prefix are only suitable for ESP32 and ESP-IDF\n  - libraries starting with the \u003cb\u003era\u003c/b\u003e prefix are only suitable for ARDUINO compatible code\n  - libraries starting with the \u003cb\u003er\u003c/b\u003e prefix can be used in both cases (in ESP-IDF and in ARDUINO)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkotyara12%2Freled","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkotyara12%2Freled","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkotyara12%2Freled/lists"}