Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "HX711.h"
- #define DOUT 3
- #define CLK 2
- HX711 scale(DOUT, CLK);
- float calibration_factor = -50000;
- void setup() {
- Serial.begin(9600);
- Serial.println("Press T to tare");
- scale.set_scale(-96650);
- scale.tare();
- }
- void loop() {
- Serial.print("Weight: ");
- Serial.print(scale.get_units(), 3);
- Serial.println(" kg");
- if(Serial.available())
- {
- char temp = Serial.read();
- if(temp == 't' || temp == 'T')
- scale.tare();
- }
- }
Add Comment
Please, Sign In to add comment