Coder Social home page Coder Social logo

dfrobot_hx711_i2c's Introduction

DFRobot_HX711_I2C

HX711 is a 24-bit A / D converter chip designed for high-precision electronic scales.
This example is suitable for HX711 sensor and read data through Arduino.

Product Image

KIT0176: I2C 1Kg Weight Sensor Kit - HX711

Table of Contents

Summary

Provide an Arduino library to get weight by reading data from HX711.

Installation

To use this library, first download the library file, paste it into the \Arduino\libraries directory, then open the examples folder and run the demo in the folder.

Methods

  /*!
   * @fn begin
   * @brief init function
   * @return return 1 if initialization succeeds, otherwise return non-zero and error code.
   */
  int begin(void);
  
  /*!
   * @fn readWeight
   * @brief Get the weight of the object
   * @param times Take the average several times
   * @return return the read weight value, unit: g
   */
  float readWeight(uint8_t times = 12);
  
  /*!
   * @fn getCalibration
   * @brief get calibration value 
   * @return return the read calibration value
   */
  float getCalibration();

  /*!
   * @fn setCalibration
   * @brief Set calibration value
   * @param value the calibration value
   */
  void  setCalibration(float value);

  /*!
   * @fn setThreshold
   * @brief Set the trigger threshold when the weight sensor module is automatically calibrated(g)
   * @param threshold threshold
   */
  void  setThreshold(uint16_t threshold);
  
  /*!
   * @fn setCalWeight
   * @brief Set the calibration weight when the weight sensor module is automatically calibrated(g)
   * @param triWeight   Weight
   */
  void  setCalWeight(uint16_t triWeight);
  
  /*!
   * @fn enableCal
   * @brief Start sensor calibration
   */
  void enableCal();
  
  /*!
   * @fn peel
   * @brief remove the peel
   */
  void peel();
  
  /*!
   * @fn getCalFlag
   * @brief Wait for sensor calibration to complete
   * @return Result 
   * @retval true The calibration completed
   * @retval false The calibration is not complete
   */
  bool getCalFlag();

Compatibility

MCU Work Well Work Wrong Untested Remarks
Arduino uno
FireBeetle-ESP8266
FireBeetle-ESP32
mpython
microbit

History

  • 2020/12/31 - Version 1.0.0 released.

Credits

Written by fengli([email protected]), 2020.12.31 (Welcome to our website)

dfrobot_hx711_i2c's People

Contributors

pleasetakeup avatar ellenlouiseripley avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.