Skip to content

Commit

Permalink
fix collecting actor
Browse files Browse the repository at this point in the history
  • Loading branch information
saniaxxx committed Jan 12, 2020
1 parent 74bb5d4 commit a417324
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions collectingActor.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 26,14 @@ def init(self):
GPIO.output(int(self.gpio), 0)

def create_timer(self):
timeON = self.power / 100.0 * float(self.period)
timeOff = float(self.period) - timeON
timeOn = self.power / 100.0 * float(self.period)
timeOff = float(self.period) - timeOn
if timeOff == 0:
self.timer = Timer(float(self.period), self.switch)
elif self.enabled:
self.timer = Timer(timeOff, self.switch)
self.timer = Timer(timeOn, self.switch)
else:
self.timer = Timer(timeON, self.switch)
self.timer = Timer(timeOff, self.switch)
self.timer.start()

def switch(self):
Expand Down

0 comments on commit a417324

Please sign in to comment.