Branching from Cathaswatch project
https://git.nerdyssey.de/exodus/1NiM-WatingRoom-WatchController
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
if __name__ == "__main__": # If the Helper.py file is run directly
|
||||
print("This is a modul and should be imported")
|
||||
|
||||
import math
|
||||
|
||||
class Stepper:
|
||||
# step as degrees
|
||||
Step : float
|
||||
# step as radiant
|
||||
StepRad : float
|
||||
# steps for full resolution
|
||||
Steps : int
|
||||
# microsteps per step
|
||||
Resolution : int
|
||||
|
||||
def __init__(self, step, res):
|
||||
self.Step = step
|
||||
self.Steps = 360 / step
|
||||
self.StepRad = math.pi * step/180
|
||||
self.Resolution = res
|
||||
|
||||
class QuadWave:
|
||||
Sine : []
|
||||
Cosine : []
|
||||
def __init__(self, resolution):
|
||||
sine = []
|
||||
cosine = []
|
||||
s = 2 * math.pi / resolution
|
||||
for i in range(resolution):
|
||||
sine.append(math.sin(s * i))
|
||||
cosine.append(math.cos(s * i))
|
||||
self.Sine = sine
|
||||
self.Cosine = cosine
|
||||
Reference in New Issue
Block a user