コード例 #1
0
 def runIteration(self):
     for i in self.mPixelsIndex:
         self.mPixels[i] = self.mColorPattern.getColor(i)
     self.mPixels.show()
     TimeFactorInstance.sleep(self.mTimeOn)
     for i in self.mPixelsIndex:
         self.mPixels[i] = (0, 0, 0)
     self.mPixels.show()
     TimeFactorInstance.sleep(self.mTimeOff)
コード例 #2
0
    def runIteration(self):
        wCycleIter = self.mIterationCount % len(self.mPixelsIndex)
        wColorIndex = wCycleIter * 256 // len(self.mPixelsIndex)
        for i in range(0, len(self.mPixelsIndex)):
            wIndex = self.mPixelsIndex[i]
            self.mPixels[wIndex] = self.mRainbow.getColor(wColorIndex)
        self.mPixels.show()
        TimeFactorInstance.sleep(self.mTime)

        self.mIterationCount += 1
        self.mIterationCount %= self.mNbCycle
コード例 #3
0
    def runIteration(self):
        for wPixelIndex in self.mPixelsIndex:
            self.mPixels[wPixelIndex] = (0, 0, 0)

        for i in self.getPixelsToLight():
            wIndex = self.mPixelsIndex[i]
            self.mPixels[wIndex] = self.getColor(i)
        self.mPixels.show()

        self.mIterationCount += 1
        self.mIterationCount % len(self.mPixelsIndex)

        TimeFactorInstance.sleep(self.mTime)
コード例 #4
0
 def runIteration(self):
     for i in range(StrobeRandomPattern.cNbPixelsPerIteration):
         wIndex = self.mPixelsIndex[random.randint(
             0,
             len(self.mPixelsIndex) - 1)]
         self.mPixels[wIndex] = self.mColorPattern.getColor(
             random.randint(0, 255))
     self.mPixels.show()
     TimeFactorInstance.sleep(self.mTimeOn)
     for i in self.mPixelsIndex:
         self.mPixels[i] = (0, 0, 0)
     self.mPixels.show()
     TimeFactorInstance.sleep(self.mTimeOff)
コード例 #5
0
    def runIteration(self):
        wCycleIter = self.getCycleIter()
        if (self.mIterationCount // len(self.mPixelsIndex)) == 0:
            wIndex = self.mPixelsIndex[wCycleIter]
            self.mPixels[wIndex] = self.getColor(wCycleIter)
            self.mPixels.show()
        else:
            wIndex = self.mPixelsIndex[wCycleIter]
            self.mPixels[wIndex] = (0, 0, 0)
            self.mPixels.show()

        self.mIterationCount += 1
        self.mIterationCount %= self.mNbCycle

        TimeFactorInstance.sleep(self.mTime)
コード例 #6
0
 def runIteration(self):
     self.mIterationCount += 1
     for i in self.mPixelsIndex:
         if self.mIterationCount % 2 == 0:
             if i < len(self.mPixelsIndex) / 2:
                 self.mPixels[i] = self.mColorPattern.getColor(i)
             else:
                 self.mPixels[i] = (0, 0, 0)
         else:
             if i < len(self.mPixelsIndex) / 2:
                 self.mPixels[i] = (0, 0, 0)
             else:
                 self.mPixels[i] = self.mColorPattern.getColor(i)
     self.mPixels.show()
     TimeFactorInstance.sleep(self.mTimeOn)
コード例 #7
0
    def runIteration(self):
        seq = [
            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 16, 31, 30, 29, 28, 27, 26,
            25, 24, 23, 22, 21, 20, 19, 13, 14, 15
        ]
        for wPixelIndex in self.mPixelsIndex:
            self.mPixels[wPixelIndex] = (0, 0, 0)

        i = seq[self.mIterationCount]
        self.mPixels[i] = self.mColorPattern.getColor(i)
        self.mPixels.show()

        self.mIterationCount += 1
        self.mIterationCount = (self.mIterationCount % len(seq))

        TimeFactorInstance.sleep(self.mTime)
コード例 #8
0
def BtHandlerSpeed(value):
    TimeFactorInstance.setFactor(float(value))
コード例 #9
0
 def runIteration(self):
     self.mIterationCount += 1
     if (self.mIterationCount % 4) == 0:
         TimeFactorInstance.sleep(self.mTimeSleep)
     super().runIteration()