{"id":18824655,"url":"https://github.com/lennarthennigs/m5facesencoder","last_synced_at":"2025-07-09T21:32:57.613Z","repository":{"id":90173684,"uuid":"323736519","full_name":"LennartHennigs/M5FacesEncoder","owner":"LennartHennigs","description":"Arduino Library for reading encoder values from the M5Stack Faces Encoder Module.","archived":false,"fork":false,"pushed_at":"2020-12-31T07:55:11.000Z","size":16,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T02:05:44.199Z","etag":null,"topics":["arduino","arduino-library","cplusplus","encoder","esp32","leds","m5stack","m5stack-faces"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LennartHennigs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-12-22T21:27:05.000Z","updated_at":"2024-08-12T04:29:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"88b96587-d8c1-42a6-9d5d-16a56bd90c61","html_url":"https://github.com/LennartHennigs/M5FacesEncoder","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/LennartHennigs/M5FacesEncoder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LennartHennigs%2FM5FacesEncoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LennartHennigs%2FM5FacesEncoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LennartHennigs%2FM5FacesEncoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LennartHennigs%2FM5FacesEncoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LennartHennigs","download_url":"https://codeload.github.com/LennartHennigs/M5FacesEncoder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LennartHennigs%2FM5FacesEncoder/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264503951,"owners_count":23618762,"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","cplusplus","encoder","esp32","leds","m5stack","m5stack-faces"],"created_at":"2024-11-08T00:57:05.124Z","updated_at":"2025-07-09T21:32:57.608Z","avatar_url":"https://github.com/LennartHennigs.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"M5StackFaces\n============\n\n* Author: Lennart Hennigs (https://www.lennarthennigs.de)\n* Copyright (C) 2020 Lennart Hennigs.\n* Released under the MIT license.\n\n\nDescription\n-----------\n\nThis class is for the M5Stack Faces [Encoder Module](https://m5stack.com/products/encoder-module). \nIt allows you to detect encoder interactions (clicks and rotation) and control the built-in LEDs.\n\n- It offers callback functions for handling the encoder events.\n- You can define a number-range for the encoder and a starting value.\n- You can also define the \"speed\" of the encoder by setting the steps-per-click.\n- Since the encode module has a led ring with 12 leds, the class also offer a function to set the color for each.\n\n- **Note:** For the class to work, you need to call the `loop()` member function in your sketch's `loop()` function. See the example for more details.\n- **Note:** The firmware of the Encode Module triggers the leds on each detected click. This is something which this library cannot disable/fix.\n\n\nHow to Use\n----------\n\nThese are the constructor and the member functions the library provides:\n\n\n```\nM5FacesEncoder();\n\nbool begin(int lower_bound = INT16_MIN , int upper_bound = INT16_MAX , int inital_pos = 0, int steps_per_click = 1);\n\nbool isPresent();\n\nvoid setStepsPerClick (int steps);\nint getStepsPerClick() const;\n\nint getPosition() const;\nvoid setPosition (int p = 0, bool fireCallback = true);\n\nbyte getDirection() const;\nString directionToString( byte direction) const;\n\nbool isPressed() const;\nunsigned long wasPressedFor() const;\n\nvoid setChangedHandler (CallbackFunction f);\nvoid setRightRotationHandler (CallbackFunction f);\nvoid setLeftRotationHandler (CallbackFunction f);\nvoid setUpperOverflowHandler (CallbackFunction f);\nvoid setLowerOverflowHandler (CallbackFunction f);\n\nvoid setClickHandler (CallbackFunction f);\nvoid setPressedHandler (CallbackFunction f);\nvoid setReleasedHandler (CallbackFunction f);\n\nvoid setLed(int i, long rgb);\nvoid setLed(int i, byte r, byte g, byte b);\n\nvoid loop();\n``` \n    \n\nInstallation\n------------\nOpen the Arduino IDE choose \"Sketch \u003e Include Library\" and search for \"Button2\". \nOr download the ZIP archive (https://github.com/lennarthennigs/M5FacesEncoder/zipball/master), and choose \"Sketch \u003e Include Library \u003e Add .ZIP Library...\" and select the downloaded file.\n\n\nLicense\n-------\n\nMIT License\n\nCopyright (c) 2020 Lennart Hennigs\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flennarthennigs%2Fm5facesencoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flennarthennigs%2Fm5facesencoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flennarthennigs%2Fm5facesencoder/lists"}