Skip to content

Commit ce9af1e

Browse files
committed
bugfix: The target position is now reached without oscillating around the final pulse
1 parent 6a8f70d commit ce9af1e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/stepper/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ def target(self,t):
4242
self.target_pos = t
4343

4444
def target_deg(self,deg):
45-
self.target(self.steps_per_rev*deg/360.0)
45+
self.target(round(self.steps_per_rev*deg/360.0))
4646

4747
def target_rad(self,rad):
48-
self.target(self.steps_per_rev*rad/(2.0*math.pi))
48+
self.target(round(self.steps_per_rev*rad/(2.0*math.pi)))
4949

5050
def get_pos(self):
5151
return self.pos

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy