bogde / HX711

An Arduino library to interface the Avia Semiconductor HX711 24-Bit Analog-to-Digital Converter (ADC) for Weight Scales.
MIT License
881 stars 535 forks source link

get_units() problem on STM32F4 #134

Open idalurf opened 5 years ago

idalurf commented 5 years ago

Hey !

Well, I'm coding on STM32 using STM32duino and I have an issue on boards Nucleo-F401RE and STM32407 Discovery, also called DISCO-F407G. By the way both are running on a M3 core.

Using the get_units() function with a parameter will crash the program.

for example this code won't work : (it will fail after 3 or 4 read)

#include "HX711.h"

// HX711 circuit wiring
const int LOADCELL_DOUT_PIN = 2;
const int LOADCELL_SCK_PIN = 3;

HX711 scale;

void setup() {
  Serial.begin(38400);
  Serial.println("HX711 Demo");
  Serial.println("Initializing the scale");
  scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
}

void loop() {
  Serial.print("\t| average:\t");
  Serial.println(scale.get_units(10), 1);
  delay(500);
}

But this works perfectly with get_units(), that's why the issue seems to be the same as for the ESP32 in #73 If you have any clue, please let me know, thank you ! :)

amotl commented 5 years ago

Dear @idalurf,

thanks for writing in. As this library has been able to gain some more attraction recently again, we are confident that we will be able to address the issue you are observing.

Please don't hesitate to get back to us if you don't hear back from anyone for a while. Personally, I'm currently a bit swamped which prevents me from dedicating myself to this right away.

With kind regards, Andreas.