Am trying to do a project that utilizes the stepper motor with load cell where am focused in running the stepper motor until the reading of the load cell goes up to greater or equal to 200. Below is the code that I am trying to write:
Code: Select all
def calcWeight(import,isbigger=True):
isWeightOk = True
while isWeightOk:
enaPin.low()
pulPin.low()
time.sleep_us(1)
pulPin.high()
time.sleep_us(1)
val = (scales.stable_value()*(0.00589)/10000
print(val)
if(isbigger):
if(val>=(import*0.001)):
isWeightOk=False
else:
if(val<=(import*0.001)):
isWeightOk=False
return True
https://github.com/SergeyPiskunov/micro ... r/hx711.py
https://www.theengineeringprojects.com/ ... stems.html