pyupm_hx711 module

class pyupm_hx711.HX711(data, sck, gain=128)[source]

Bases: object

API for the HX711 Analog-to-Digital Converter.

ID: hx711

Name: 24-bit Analog-to-digital Converter

Category: electric

Manufacturer: generic

Link:http://www.dfrobot.com/image/data/SEN0160/hx711_english.pdf

Connection: gpio HX711 is a precision 24-bit analog-to-digital converter (ADC) designed for weight scales and industrial control applications to interface directly with a bridge sensor. This module was tested on the Intel(R) Galileo Gen 2 board.

C++ includes: hx711.hpp

getUnits(times=1)[source]

float getUnits(uint8_t times=1)

Returns getValue() divided by SCALE

times: Defines how many readings to do

Raw value divided by a value obtained via calibration

getValue(times=10)[source]

double getValue(uint8_t times=10)

Returns ( readAverage() - OFFSET)

times: Defines how many readings to do

Current value without the tare weight

read()[source]

unsigned long read()

Waits for the chip to be ready and returns a reading

Raw ADC reading

readAverage(times=10)[source]

unsigned long readAverage(uint8_t times=10)

Returns an average reading

times: Defines how many reading to do

Average reading

setGain(gain=128)[source]

void setGain(uint8_t gain=128)

Sets the gain factor; takes effect only after a call to read() channel A can be set for a 128 or 64 gain; channel B has a fixed 32-gain factor depending on the parameter; the channel is also set to either A or B

gain: Defines the gain factor

setScale(scale=1.0)[source]

void setScale(float scale=1.f)

Sets the SCALE value This value is used to convert the raw data to human-readable data (measurement units)

scale: Value obtained via calibration

tare(times=10)[source]

void tare(uint8_t times=10)

Sets the OFFSET value for the tare weight

times: Defines how many times to read the tare value