{"id":15011914,"url":"https://github.com/avjui/hx711","last_synced_at":"2026-01-21T02:32:41.845Z","repository":{"id":244579734,"uuid":"815575227","full_name":"avjui/hx711","owner":"avjui","description":"HX711 Library for esp-idf written in cpp","archived":false,"fork":false,"pushed_at":"2024-06-16T18:24:00.000Z","size":3190,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T04:29:12.254Z","etag":null,"topics":["esp-idf","esp32","hx711","platformio"],"latest_commit_sha":null,"homepage":"https://avjui.github.io/hx711/","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/avjui.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":"2024-06-15T14:12:35.000Z","updated_at":"2024-09-10T11:03:06.000Z","dependencies_parsed_at":"2025-04-09T04:37:54.051Z","dependency_job_id":null,"html_url":"https://github.com/avjui/hx711","commit_stats":null,"previous_names":["avjui/hx711"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/avjui/hx711","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avjui%2Fhx711","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avjui%2Fhx711/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avjui%2Fhx711/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avjui%2Fhx711/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avjui","download_url":"https://codeload.github.com/avjui/hx711/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avjui%2Fhx711/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28623277,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T23:49:58.628Z","status":"online","status_checked_at":"2026-01-21T02:00:08.227Z","response_time":86,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["esp-idf","esp32","hx711","platformio"],"created_at":"2024-09-24T19:41:53.124Z","updated_at":"2026-01-21T02:32:41.828Z","avatar_url":"https://github.com/avjui.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HX711 Library\n\n\u003cimg src=\"doc/_static/logo.png\" width=\"200\" height=\"200\"\u003e\n\n![platformio build](https://github.com/avjui/hx711/actions/workflows/build.yml/badge.svg)  ![GitHub Issues or Pull Requests](https://img.shields.io/github/issues/avjui/hx711)  [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\n## Table of Contents\n\n- [HX711 Library](#hx711-library)\n  - [Table of Contents](#table-of-contents)\n  - [About ](#about-)\n  - [Getting Started ](#getting-started-)\n    - [Installing ](#installing-)\n      - [ESP-IDF ](#esp-idf-)\n      - [Platformio ](#platformio-)\n  - [Usage ](#usage-)\n  - [Documentation ](#documentation-)\n  - [Todo ](#todo-)\n\n## About \u003ca name = \"about\"\u003e\u003c/a\u003e\n\nThis library is for the hx711 modul to read weight load.\nIt is build for esp-idf framework and written in C++! \n\n## Getting Started \u003ca name = \"getting_started\"\u003e\u003c/a\u003e\n\nGoal of this project is to provide an easy to use library for the hx711 modul written in C++! \n\nThe main featers are:\n - Easy to use\n - Reading value from hx711 modul in background task\n - Create average value from `x` samples to get more accurate results\n - Remove highest and lowest value to get more accurate results\n\n\n### Installing \u003ca name = \"installing\"\u003e\u003c/a\u003e\n\n#### ESP-IDF \u003ca name = \"esp-idf\"\u003e\u003c/a\u003e\n\nThe library contains a `idf_compent.yml` file. So you can install it with the esp-idf packagemanager to be aviable in your project.\n\nTo integerate it to your project create a file named `idf_compent.yml` and put following lines in it.\n\n```\ndependencies:\n  idf: \"\u003e=4.4\"\n\n  hx711:\n    git: https://github.com/avjui/hx711.git\n```\n:file_folder: The file was also aviable in the [example folder main dirctory](./example/main/).\n\nAfter this installation is complete and you can build your project with th hx711 library.\n\n#### Platformio \u003ca name = \"platformio\"\u003e\u003c/a\u003e\n\nTo use this library in platformio you can add `lib_deps` to your configuration file `platformio.ini`\n\n```\nlib_deps = \n    git+https://github.com/avjui/hx711\n```\n:warning: Because platformio not regiester the `Kconfig` by him self you have to add `Kconfig` with editing `CMakeLists.txt`, or add the config variables to `platfomrio.ini`.\n\n- First option is to add following lines to `CMakeLists.txt` in the root directory.\n\n```\nget_filename_component(configName \"${CMAKE_BINARY_DIR}\" NAME)\nlist(APPEND kconfigs \"${CMAKE_SOURCE_DIR}/.pio/libdeps/${configName}/hx711/Kconfig\")\n```\n\n- An other option is to add the config to `platformio.ini`.\n\n```\n[hx711]\n; Build flags for hx711 library\nbuild_flags=\n    -D CONFIG_HX711_PIN_PDSCK=26 ; clock pin\n    -D CONFIG_HX711_PIN_PDOUT=25 ; out pin\n    -D CONFIG_HX711_SCALE=491    ; scale factor\n    -D CONFIG_HX711_TARETIME=20  ; samples we use for tare       \n    -D CONFIG_HX711_SAMPLES=10   ; samples we use for avarge value\n    -D CONFIG_HX711_WAIT_TIME=2  ; time to wait when toggle pins\n    -D CONFIG_HX711_GAIN=1       ; Gain channel A 128=1, 32=3, channel B 64=2 \n\n    [env:...]\n    ....\n\n    build_flags = \n        ${hx711.build_flags}\n\n\n```\n## Usage \u003ca name = \"usage\"\u003e\u003c/a\u003e\n\nAdd notes about how to use the system.\n\n```\n#include \u003chx711.h\u003e\n```\n\nAfter the we declare it\n\n```\nHX711 load();\n```\n\nThen we can tare the weight scale\n\n```\nload.tare()\n```\n\nThen we can start the background task and read the value\n\n```\nload.startTask();\nfor(;;) \n{\n    ESP_LOGI(\"MAIN\", \"Weight : %.2f g\", load.getLoad());\n    vTaskDelay(2000/portTICK_PERIOD_MS);\n}\n\n```\n\nYou can find an example in the [example folder](./example)\n\n## Documentation \u003ca name = \"documentation\"\u003e\u003c/a\u003e\n\nFor more information you can have a look at the [documentation](https://avjui.github.io/hx711/).\n\n\n## Todo \u003ca name = \"todo\"\u003e\u003c/a\u003e\n\n - add function to set scale factor","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favjui%2Fhx711","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favjui%2Fhx711","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favjui%2Fhx711/lists"}