self.stepper.single_step(1) # step in
cd = self.piezo.read_deflection()
- def move_away_from_surface(stepper, distance=None):
+ def move_toward_surface(self, distance):
+ """Step in approximately `distance` meters.
+ """
+ steps = int(distance/self.stepper.step_size)
+ _LOG.info('step in {} steps (~{} m)' % (steps, distance))
+ self.stepper.step_relative(steps)
+
+ def move_away_from_surface(self, distance=None):
"""Step back approximately `distance` meters.
"""
if distance is None:
distance = self.config['far']
- steps = int(distance/self.stepper.step_size)
- _LOG.info('step back {} steps (~{} m)' % (steps, distance))
- self.stepper.step_relative(-steps)
+ self.move_toward_surface(-distance)