Package SmootLight :: Package pixelevents :: Module SynchTestEvent
[hide private]
[frames] | no frames]

Source Code for Module SmootLight.pixelevents.SynchTestEvent

 1  from operationscore.PixelEvent import * 
2 -class SynchTestEvent(PixelEvent):
3 """SynchTestEvent is an event to test the synchronization of the power supplies"""
4 - def initEvent(self):
5 self.eventstate = 0 6 self.cachedDelay = 0
7 - def state(self, timeDelay):
8 if timeDelay != self.cachedDelay: 9 self.eventstate += 1 10 self.cachedDelay = timeDelay 11 color = [0]*3 12 color[self.eventstate % 3] = 150 13 if self.eventstate > 500: 14 self.eventstate = 0 15 return color
16