diff --git a/lunabot_embedded/firmware/teensy_main/lib/lunabot_drivers/interfaces.cpp b/lunabot_embedded/firmware/teensy_main/lib/lunabot_drivers/interfaces.cpp index c9c41e43..69c2e2db 100644 --- a/lunabot_embedded/firmware/teensy_main/lib/lunabot_drivers/interfaces.cpp +++ b/lunabot_embedded/firmware/teensy_main/lib/lunabot_drivers/interfaces.cpp @@ -236,13 +236,13 @@ HX711 HX711_Bus::encs[NUM_SENSORS] = { void HX711_Bus::init() { for (int i = 0; i < NUM_SENSORS; i++) { + encs[i].set_raw_mode(); + encs[i].set_scale(SCALE_CALIBRATION[i]); encs[i].begin(PIN_LIST[i * 2], PIN_LIST[i * 2 + 1]); if (encs[i].is_ready()) { encs[i].tare(); } encs[i].set_gain(HX711_CHANNEL_A_GAIN_128); - encs[i].set_scale(SCALE_CALIBRATION[i]); - encs[i].set_raw_mode(); } } @@ -250,7 +250,7 @@ float HX711_Bus::read_scale(uint8_t id) { if (encs[id].is_ready()) { // since we could start with weight on the load cell, manually subtract zero point instead of // taring - float val = encs[id].read(); + float val = encs[id].get_units(1); // if load cell is not returning any data, but HX711 is connected if (val == 0) return -1;