Hi folks,
I try this setup for doing this project:
- Arduino: 1.8.4 (Mac OS X)
- Board: "DOIT ESP32 DEVKIT V1
- HX711 load cell amplifiyer
- hx711.h library from here
- H20A load cell
Uploading this sketch...
#include "HX711.h"
// HX711.DOUT - pin #A1
// HX711.PD_SCK - pin #A0
HX711 scale(11, 12); // parameter "gain" is ommited; the default value 128 is used by the library
void setup() {
Serial.begin(38400);
Serial.println("HX711 Demo");
Serial.println("Before setting up the scale:");
Serial.print("read: \t\t");
Serial.println(scale.read()); // print a raw reading from the ADC
Serial.print("read average: \t\t");
Serial.println(scale.read_average(20)); // print the average of 20 readings from the ADC
Serial.print("get value: \t\t");
Serial.println(scale.get_value(5)); // print the average of 5 readings from the ADC minus the tare weight (not set yet)
Serial.print("get units: \t\t");
Serial.println(scale.get_units(5), 1); // print the average of 5 readings from the ADC minus tare weight (not set) divided
// by the SCALE parameter (not set yet)
scale.set_scale(2280.f); // this value is obtained by calibrating the scale with known weights; see the README for details
scale.tare(); // reset the scale to 0
Serial.println("After setting up the scale:");
Serial.print("read: \t\t");
Serial.println(scale.read()); // print a raw reading from the ADC
Serial.print("read average: \t\t");
Serial.println(scale.read_average(20)); // print the average of 20 readings from the ADC
Serial.print("get value: \t\t");
Serial.println(scale.get_value(5)); // print the average of 5 readings from the ADC minus the tare weight, set with tare()
Serial.print("get units: \t\t");
Serial.println(scale.get_units(5), 1); // print the average of 5 readings from the ADC minus tare weight, divided
// by the SCALE parameter set with set_scale
Serial.println("Readings:");
}
void loop() {
Serial.print("one reading:\t");
Serial.print(scale.get_units(), 1);
Serial.print("\t| average:\t");
Serial.println(scale.get_units(10), 1);
scale.power_down(); // put the ADC in sleep mode
delay(5000);
scale.power_up();
}
...causes the following problem:
Arduino: 1.8.4 (Mac OS X), Board: "DOIT ESP32 DEVKIT V1, 80MHz, 921600, None"
Archiving built core (caching) in: /var/folders/71/5csrzsms2ql656c5g1brxsyc0000gn/T/arduino_cache_248763/core/core_espressif_esp32_esp32doit-devkit-v1_FlashFreq_80,UploadSpeed_921600,DebugLevel_none_81022c23036f627a596faae2df69ec69.a
arduino.ar(esp32-hal-misc.c.o): In functionyield': /Users/Michael/Documents/Arduino/hardware/espressif/esp32/cores/esp32/esp32-hal-misc.c:36: multiple definition ofyield'
libraries/HX711-master/HX711.cpp.o:/Users/Michael/Documents/Arduino/libraries/HX711-master/HX711.cpp:7: first defined here
collect2: error: ld returned 1 exit status
exit status 1
Fehler beim Kompilieren für das Board DOIT ESP32 DEVKIT V1.Dieser Bericht wäre detaillierter, wenn die Option
"Ausführliche Ausgabe während der Kompilierung"
in Datei -> Voreinstellungen aktiviert wäre.
I hope someone can help me with this issue, because I do notknow what to do with this information about "yield".
THX
Michael