Advertisement
talofer99

hx711

Aug 11th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include "HX711.h"
  2.  
  3.  
  4. // HX711 circuit wiring
  5. const int DOUT = D2;
  6. const int CLK = D1;
  7.  
  8.  
  9.  
  10. void setup() {
  11. Serial.begin(1150200);
  12. Serial.println("Started");
  13. HX711 scale(DOUT, CLK);
  14. scale.set_scale();
  15. scale.tare();
  16. }
  17.  
  18. void loop() {
  19. scale.set_scale(calibration_factor);
  20. float weight = scale.get_units();
  21. Serial.print(weight, 2);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement