This commit is contained in:
gac-S_Changer
2018-10-11 13:42:31 +02:00
parent 37e183bd30
commit cfc4b3a0da
18 changed files with 1025 additions and 511 deletions

View File

@@ -155,4 +155,16 @@ def get_sample_name(segment, puck, sample):
puck_name = get_puck_name(segment, puck)
return None if (puck_name is None) else puck_name + str(sample)
def is_pin_detected_in_scanner():
samples = []
for i in range(10):
samples.append(laser_distance.read())
time.sleep(0.05)
av = mean(samples)
for s in samples:
if s<=1:
return False
if abs(s-av) > 0.1:
return False
return True