This commit is contained in:
seo-amugae committed 2026-02-24 18:30:51 +09:00
1 parent e429161a89
commit 0c55b8f1aa
134 files changed
+6071 -5801

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
from hx711 import HX711
import json, time
DT_PIN = 5
SCK_PIN = 6
with open("hx711_calib.json") as f:
calib = json.load(f)
OFFSET = calib["offset"]
SCALE = calib["scale"]
hx = HX711(DT_PIN, SCK_PIN)
hx.set_offset(OFFSET)
hx.set_reference_unit(SCALE)
print(" 무게 측정 시작")
while True:
weight = hx.get_weight(10)
print(f"무게: {weight:.1f} g")
time.sleep(0.5)