How to include HX711 component library?

SteaLTH_INSteaD
Posts: 5
Joined: Sun Feb 16, 2020 4:20 am

How to include HX711 component library?

Postby SteaLTH_INSteaD » Sun Feb 16, 2020 4:33 am

I am having trouble including external component libraries. I was reading https://docs.espressif.com/projects/esp ... ystem.html - but still having trouble understanding all the file structures and flow.

I am trying to include HX711 library from https://github.com/UncleRus/esp-idf-lib

Can anyone help explain the process? I tried a few different methods and it doesn't seem to be working. I am using Visual Studio code with ESP-IDF extension

I did the following steps:
1. cd ~/myprojects/esp
2. git clone https://github.com/UncleRus/esp-idf-lib.git
3. Update makefile to include: "EXTRA_COMPONENT_DIRS := $(IDF_PATH)/esp-idf-lib/components"
4. #include "HX711.h" in my main.c file.

I also tried:
1. Adding the external component library with HX711 in the same directory as my main file, but still not working.

User avatar
ESP_krzychb
Posts: 400
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: How to include HX711 component library?

Postby ESP_krzychb » Sun Feb 16, 2020 10:13 am

Hi SteaLTH_INSteaD,

Have you tried to build your project from command line to eliminate possible misconfiguration of Visual Studio code?

cd ~/esp/esp-idf
./install.sh
. ./export.sh

cd ~/myprojects/esp
idf.py flash monitor

Here is a simple project that includes component from https://github.com/UncleRus/esp-idf-lib:
https://github.com/krzychb/esp32-lna/tr ... uple-basic.

Admittedly I have not tried it with with Visual Studio code, but it builds and runs correctly from command line.

EDIT: Please note to update "CMakeLists.txt" in your project, I realized you mentioned "makefile" which is for legacy GNU Make system.

Who is online

Users browsing this forum: No registered users and 190 guests