kopia lustrzana https://github.com/jamesgao/kiln_controller
Fix bugs in stepper
rodzic
d1c516ec59
commit
2a216d4477
|
@ -62,12 +62,12 @@ class Stepper(threading.Thread):
|
|||
self._step_noblock(step, speed)
|
||||
|
||||
try:
|
||||
step, speed = self.queue.get(True, self.timeout)
|
||||
step, speed, block = self.queue.get(True, self.timeout)
|
||||
except Queue.Empty:
|
||||
#handle the timeout, turn off all pins
|
||||
for pin in self.pins:
|
||||
GPIO.output(pin, False)
|
||||
step, speed = self.queue.get()
|
||||
step, speed, block = self.queue.get()
|
||||
|
||||
for pin in self.pins:
|
||||
GPIO.output(pin, False)
|
||||
|
|
|
@ -3,11 +3,11 @@ import stepper
|
|||
|
||||
def test_noblock():
|
||||
reg = Regulator(ignite_pin=None)
|
||||
reg.start()
|
||||
|
||||
reg.ignite()
|
||||
reg.set(.5)
|
||||
time.sleep(.5)
|
||||
reg.set(.1)
|
||||
time.sleep(.5)
|
||||
reg.set(.5, block=True)
|
||||
reg.set(.5, block=True)
|
||||
return reg
|
Ładowanie…
Reference in New Issue