I'm playing with/learning load cells. Wrote some come code that works on an Arduino Uno, but not the ESP32.
Code: Select all
#include "HX711.h"
#define DOUT 3
#define CLK 2
float seed = -385.95;
HX711 scale(DOUT, CLK);
void setup() {
Serial.begin(9600);
scale.set_scale(seed);
scale.tare();
}
void loop() {
scale.set_scale(seed);
if (Serial.available()) {
char z = Serial.read();
if (z == '-') seed -= 0.1;
if (z == '+') seed += 0.1;
}
Serial.print("Seed value: ");
Serial.print(seed);
Serial.print("\tWeight:\t");
Serial.println(scale.get_units(10), 1);
Serial.print("\tWeight:\t");
Serial.println((scale.get_units(10), 1)/453.0f);
Serial.println("\t lbs.");
}
I not even using the 'yield' function, that I'm aware of.C:\Users\LAB_BE~1\AppData\Local\Temp\arduino_build_878347/arduino.ar(esp32-hal-misc.c.o): In function `yield':
C:\Users\Lab_Bench\Documents\Arduino\hardware\espressif\esp32\cores\esp32/esp32-hal-misc.c:38: multiple definition of `yield'
libraries\HX711-master\HX711.cpp.o:C:\Users\Lab_Bench\Documents\Arduino\libraries\HX711-master/HX711.cpp:7: first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board ESP32 Dev Module.
Any enlightenment will be greatly appreciated.
Thanks