參考Github:https://github.com/RobTillaart/HX711
參數意義參考:https://www.yiboard.com/thread-1241-1-1.html
set_scale();函數將用於刻度校准的calibration_factor設置為所需的值,tare(); 函數將其設置歸零。
get_units(); 函數讀取重量,如果小於零,則認為是零。
First action is to call begin(DATAPIN, CLOCKPIN) to make connetion to the HX711.
Second step is callibration for which a number of functions exist.
- tare() measures zero point(清零校准)
- set_scale(factor) set a known conversion factor e.g. from EEPROM.(設置已知的轉換因子,就是校准系數)
- callibrate_scale(WEIGHT, TIMES) determines the scale factor based upon a known weight e.g. 1 Kg.(根據已知的權重確定比例因子,例如1公斤)