Ejemplo n.º 1
0
 def setDigit(self, row, column, digit, color=None):
     """
         Sets the tile at row, column to the provided digit.
     """
     tile = self.tiles[row][column]
     try:
         tile.setShape(Shapes.digitToHex(int(digit)))
         if color is not None:
             tile.setColor(color)
     except AttributeError:
         print("SetDigit failed: No tile exists at ({:d},{:d}).".format(row, column))
Ejemplo n.º 2
0
def main():
    print("Testing LSDisplay with virtual floor")
    display = LSDisplay(3,8)

    for j in range(8):
        display.setColor(0, j, Colors.RED)
        display.setShape(0, j, Shapes.ZERO)
    wait(0.2)
    for j in range(8):
        display.setColor(1, j, Colors.YELLOW)
        display.setShape(1, j, Shapes.ZERO)
    wait(0.2)
    for j in range(8):
        display.setColor(2, j, Colors.GREEN)
        display.setShape(2, j, Shapes.ZERO)
    wait(0.2)
    for i in range(3):
        for j in range(8):
            display.setShape(i, j, Shapes.digitToHex(i))
            wait(0.01)
    wait(0.2)
    for i in range(0, 100):
        display.heartbeat()