[riot-notifications] [RIOT-OS/RIOT] Add hx711 ADC driver and saul (#14039)
notifications at github.com
Thu May 7 12:34:51 CEST 2020
### Contribution description
HX711 ADC driver for weigh scales. Including SAUL implementation.
### Testing procedure
1. Connect a [HX711 board](https://www.aliexpress.com/item/32860114708.html?spm=a2g0o.productlist.0.0.4be040a8DVInYv&algo_pvid=27c0c163-55f8-456b-8499-f39d9c0b1a3a&algo_expid=27c0c163-55f8-456b-8499-f39d9c0b1a3a-1&btsid=0ab6f83115888462128168492e1b17&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_) to a load cell on channel A.
2. Connect DT (DOUT) and SCK to a GPIO pin of your board.
3. Go into `tests/drvier_hx711` and change the values of `HX711_PARAM_SCK`, `HX711_PARAM_DOUT`. If you use another board, change it as well.
4. Execute the test
1. Connect the HX711 board to a weigh scale on channel A. Connect the hx711 breakout board to your microcontroller board.
2. Go into `examples/saul` and add the following to the Makefile. Change the values accordingly.
USEMODULE += hx711
CFLAGS += "-DHX711_PARAM_SCK=GPIO_PIN(1, 13)"
CFLAGS += "-DHX711_PARAM_DOUT=GPIO_PIN(1, 14)"
3. Flash the saul example and also use the target `term`.
4. Use `saul write [ID] 200` to tare the scale.
5. Place a weight on your scale and execute `saul read [TIMES]` where `[TIMES]` is the number of reads. It should show the correct weight. If not, you have to adapt the divider. It is the value of `HX711_PARAM_DIVIDER`. If the weight result is too high, set a higher divider. If it is too low, you have to lower the divider. Until you have the correct value. You should use standardized weights in order to get precise results.
### Issues/PRs references
Previous PR: #11416
You can view, comment on, or merge this pull request online at:
-- Commit Summary --
* Add hx711 ADC driver and saul
-- File Changes --
M drivers/Makefile.dep (4)
M drivers/Makefile.include (4)
A drivers/hx711/Makefile (1)
A drivers/hx711/hx711.c (136)
A drivers/hx711/hx711_saul.c (49)
A drivers/hx711/include/hx711_params.h (97)
A drivers/include/hx711.h (122)
M drivers/include/saul.h (3)
A drivers/saul/init_devs/auto_init_hx711.c (67)
M drivers/saul/init_devs/init.c (4)
M drivers/saul/saul_str.c (1)
A tests/driver_hx711/Makefile (9)
A tests/driver_hx711/main.c (51)
-- Patch Links --
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications