Ejemplo n.º 1
0
    def step(self, amt=1):
        self._led.all_off()
        t = time.localtime()
        hrs = t.tm_hour % 12
        mins = t.tm_min
        sec = t.tm_sec

        p_hrs = pointOnCircle(self._centerX, self._centerY,
                              int(self.hand_length * 0.7), hrs * 30)
        p_min = pointOnCircle(self._centerX, self._centerY, self.hand_length,
                              mins * 6)
        p_sec = pointOnCircle(self._centerX, self._centerY, self.hand_length,
                              sec * 6)

        self._led.drawLine(self._centerX,
                           self._centerY,
                           p_hrs[0],
                           p_hrs[1], (255, 0, 0),
                           aa=self.aa)
        self._led.drawLine(self._centerX,
                           self._centerY,
                           p_min[0],
                           p_min[1], (0, 255, 0),
                           aa=self.aa)
        self._led.drawLine(self._centerX,
                           self._centerY,
                           p_sec[0],
                           p_sec[1], (0, 0, 255),
                           aa=self.aa)

        self._step = 0
Ejemplo n.º 2
0
    def step(self, amt=1):
        self._led.all_off()
        t = time.localtime()
        hrs = t.tm_hour % 12
        min = t.tm_min
        sec = t.tm_sec

        p_hrs = pointOnCircle(self._centerX, self._centerY,
                              int(self._centerX * 0.7), hrs * 30)
        p_min = pointOnCircle(self._centerX, self._centerY, self._centerX,
                              min * 6)
        p_sec = pointOnCircle(self._centerX, self._centerY, self._centerX,
                              sec * 6)

        c_hrs = colors.hue2rgb_rainbow(t.tm_hour * (256 / 24))

        c_min = colors.hue2rgb_rainbow(min * (256 / 60))

        c_sec = colors.hue2rgb_rainbow(sec * (256 / 60))

        self._led.drawLine(self._centerX, self._centerY, p_hrs[0], p_hrs[1],
                           c_hrs)
        self._led.drawLine(self._centerX, self._centerY, p_min[0], p_min[1],
                           c_min)
        self._led.drawLine(self._centerX, self._centerY, p_sec[0], p_sec[1],
                           c_sec)

        self._step = 0
    def step(self, amt=1):
        self._led.all_off()
        a = pointOnCircle(self._cx, self._cy, self._radius, self._angles[0])
        b = pointOnCircle(self._cx, self._cy, self._radius, self._angles[1])
        c = pointOnCircle(self._cx, self._cy, self._radius, self._angles[2])

        color = colors.hue2rgb_360(self._angles[0])

        self._led.drawLine(a[0], a[1], b[0], b[1], color, aa=self.aa)
        self._led.drawLine(b[0], b[1], c[0], c[1], color, aa=self.aa)
        self._led.drawLine(c[0], c[1], a[0], a[1], color, aa=self.aa)

        self._angles = self.__stepAngles(self._angles, amt)
    def step(self, amt = 1):
        self._led.all_off()
        a = pointOnCircle(self._cx, self._cy, self._radius, self._angles[0])
        b = pointOnCircle(self._cx, self._cy, self._radius, self._angles[1])
        c = pointOnCircle(self._cx, self._cy, self._radius, self._angles[2])

        color = colors.hue2rgb_360(self._angles[0])

        self._led.drawLine(a[0], a[1], b[0], b[1], color)
        self._led.drawLine(b[0], b[1], c[0], c[1], color)
        self._led.drawLine(c[0], c[1], a[0], a[1], color)

        self._angles = self.__stepAngles(self._angles, amt)
    def step(self, amt = 1):
        self._led.all_off()
        t = time.localtime()
        hrs = t.tm_hour % 12
        min = t.tm_min
        sec = t.tm_sec

        p_hrs = pointOnCircle(self._centerX, self._centerY, int(self._centerX *0.7), hrs * 30)
        p_min = pointOnCircle(self._centerX, self._centerY, self._centerX, min * 6)
        p_sec = pointOnCircle(self._centerX, self._centerY, self._centerX, sec * 6)

        self._led.drawLine(self._centerX, self._centerY, p_hrs[0], p_hrs[1], (255, 0, 0))
        self._led.drawLine(self._centerX, self._centerY, p_min[0], p_min[1], (0, 255, 0))
        self._led.drawLine(self._centerX, self._centerY, p_sec[0], p_sec[1], (0, 0, 255))

        self._step = 0
Ejemplo n.º 6
0
    def step(self, amt=1):
        self._led.all_off()
        t = time.localtime()
        hrs = t.tm_hour % 12
        mins = t.tm_min
        sec = t.tm_sec

        p_hrs = pointOnCircle(self._centerX, self._centerY,
                              int(self.hand_length * 0.7), hrs * 30)
        p_min = pointOnCircle(self._centerX, self._centerY, self.hand_length,
                              mins * 6)
        p_sec = pointOnCircle(self._centerX, self._centerY, self.hand_length,
                              sec * 6)

        c_hrs = colors.hue2rgb_rainbow(hrs * (256 / 12))

        c_min = colors.hue2rgb_rainbow(mins * (256 / 60))

        c_sec = colors.hue2rgb_rainbow(sec * (256 / 60))

        self._led.drawLine(self._centerX,
                           self._centerY,
                           p_hrs[0],
                           p_hrs[1],
                           c_hrs,
                           aa=self.aa)
        self._led.drawLine(self._centerX,
                           self._centerY,
                           p_min[0],
                           p_min[1],
                           c_min,
                           aa=self.aa)
        self._led.drawLine(self._centerX,
                           self._centerY,
                           p_sec[0],
                           p_sec[1],
                           c_sec,
                           aa=self.aa)

        self._step = 0
    def step(self, amt = 1):
        self._led.all_off()
        t = time.localtime()
        hrs = t.tm_hour % 12
        min = t.tm_min
        sec = t.tm_sec

        p_hrs = pointOnCircle(self._centerX, self._centerY, int(self._centerX * 0.7), hrs * 30)
        p_min = pointOnCircle(self._centerX, self._centerY, self._centerX, min * 6)
        p_sec = pointOnCircle(self._centerX, self._centerY, self._centerX, sec * 6)

        c_hrs = colors.hue2rgb_rainbow(t.tm_hour * (256/24))

        c_min = colors.hue2rgb_rainbow(min * (256/60))

        c_sec = colors.hue2rgb_rainbow(sec * (256/60))

        self._led.drawLine(self._centerX, self._centerY, p_hrs[0], p_hrs[1], c_hrs)
        self._led.drawLine(self._centerX, self._centerY, p_min[0], p_min[1], c_min)
        self._led.drawLine(self._centerX, self._centerY, p_sec[0], p_sec[1], c_sec)

        self._step = 0