Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/SergeyPiskunov/micropython-hx711
Micropython driver for HX711 24-Bit Analog-to-Digital Converter
https://github.com/SergeyPiskunov/micropython-hx711
Last synced: 3 months ago
JSON representation
Micropython driver for HX711 24-Bit Analog-to-Digital Converter
- Host: GitHub
- URL: https://github.com/SergeyPiskunov/micropython-hx711
- Owner: SergeyPiskunov
- License: mit
- Created: 2018-03-25T14:00:09.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-01-16T23:29:55.000Z (10 months ago)
- Last Synced: 2024-07-01T10:43:28.373Z (4 months ago)
- Language: Python
- Size: 15.6 KB
- Stars: 77
- Watchers: 6
- Forks: 24
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-micropython - micropython-hx711 - MicroPython driver for HX711 24-Bit Analog-to-Digital Converter. (Libraries / Sensors)
README
# micropython-hx711
Micropython driver for the HX711 24-Bit Analog-to-Digital ConverterLatest version supports:
- retrieving data from the channel 'A' with gain 128 and 64,
the channel 'B' with gain 32 in a raw form and a form
converted from the two's complement.
- sending "power off" sequence to switch device to the power-saving mode.
- sending "power on" sequence with the gain saved before the "power off".
- checking if the device is ready for the data retrieval.#### Example for the ESP8266:
D_OUT pin is connected to the GPIO 5
PD_SCK pin is connected to the GPIO 4
Using internal HX711 oscillator, so ESP8266's frequency is set to 160000000
```
>>> from machine import freq
>>> freq(160000000)
>>>
>>> from hx711 import HX711
>>>
>>> driver = HX711(d_out=5, pd_sck=4)
>>> driver
HX711 on channel A, gain=128
>>> driver.read()
74342
>>>
>>> driver.channel=HX711.CHANNEL_A_64
>>> driver.channel
('A', 64)
>>> driver.read()
36328
>>>
>>> driver.power_off()
```