diff --git a/components/led_screen.py b/components/led_screen.py index 19df5147..10d410b0 100644 --- a/components/led_screen.py +++ b/components/led_screen.py @@ -22,7 +22,7 @@ def __init__(self): self.image_num_rows = logo_num_rows self.current_image_row = 0 # Move the image after this number of ticks - self.animation_period = 3 + self.animation_period = 20 self.current_animation_cycle = 0 def setup(self) -> None: @@ -74,7 +74,7 @@ def load_row(self, image_row) -> None: third_image_row = ( second_image_row + self.IMAGE_ROWS_BETWEEN_LED_ROWS ) % self.image_num_rows - for i in len(self.image[image_row]): + for i in range(0, len(self.image[image_row])): self.led_raster[0][i].setRGB( self.image[image_row][i][0], self.image[image_row][i][1], diff --git a/components/logo.py b/components/logo.py index af668ff5..1635e5c1 100644 --- a/components/logo.py +++ b/components/logo.py @@ -4,12 +4,11 @@ [255, 255, 255], [255, 255, 255], [255, 255, 255], - [255, 246, 246], - [246, 231, 231], - [231, 69, 69], - [69, 119, 119], - [119, 216, 216], - [216, 255, 255], + [246, 246, 246], + [231, 231, 231], + [69, 69, 69], + [119, 119, 119], + [216, 216, 216], [255, 255, 255], [255, 255, 255], [255, 255, 255], @@ -17,227 +16,228 @@ [255, 255, 255], [255, 255, 255], [255, 255, 255], - [255, 216, 216], - [216, 119, 119], - [119, 69, 69], - [69, 231, 231], - [231, 246, 246], - [246, 255, 255], + [255, 255, 255], + [255, 255, 255], + [216, 216, 216], + [119, 119, 119], + [69, 69, 69], + [231, 231, 231], + [246, 246, 246], [255, 255, 255], [255, 255, 255], ], [ - [255, 221, 221], - [221, 128, 128], - [128, 116, 116], - [116, 129, 129], - [129, 138, 138], - [138, 103, 103], - [103, 216, 216], - [216, 145, 145], - [145, 115, 115], - [115, 237, 237], - [237, 255, 255], - [255, 255, 255], - [255, 255, 255], - [255, 255, 255], - [255, 237, 237], - [237, 114, 114], - [114, 144, 144], - [144, 216, 216], - [216, 103, 103], - [103, 138, 138], - [138, 129, 129], - [129, 116, 116], - [116, 129, 129], - [129, 221, 221], + [221, 221, 221], + [128, 128, 128], + [116, 116, 116], + [129, 129, 129], + [138, 138, 138], + [103, 103, 103], + [216, 216, 216], + [145, 145, 145], + [115, 115, 115], + [237, 237, 237], + [255, 255, 255], + [255, 255, 255], + [255, 255, 255], + [255, 255, 255], + [237, 237, 237], + [114, 114, 114], + [144, 144, 144], + [216, 216, 216], + [103, 103, 103], + [138, 138, 138], + [129, 129, 129], + [116, 116, 116], + [129, 129, 129], + [221, 221, 221], ], [ - [221, 187, 187], - [187, 116, 116], - [116, 108, 108], - [108, 233, 233], - [233, 255, 255], + [221, 221, 221], + [187, 187, 187], + [116, 116, 116], + [108, 108, 108], + [233, 233, 233], + [255, 255, 255], + [255, 255, 255], [255, 255, 255], [255, 255, 255], + [228, 228, 228], + [107, 107, 107], + [210, 210, 210], + [255, 255, 255], [255, 255, 255], - [255, 228, 228], - [228, 107, 107], - [107, 210, 210], - [210, 255, 255], + [209, 209, 209], + [106, 106, 106], + [228, 228, 228], [255, 255, 255], - [255, 209, 209], - [209, 106, 106], - [106, 228, 228], - [228, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], - [255, 233, 233], - [233, 108, 108], - [108, 116, 116], - [116, 187, 187], + [233, 233, 233], + [108, 108, 108], + [116, 116, 116], ], [ - [187, 255, 255], - [255, 239, 239], - [239, 94, 94], - [94, 210, 210], - [210, 255, 255], + [187, 187, 187], + [255, 255, 255], + [239, 239, 239], + [94, 94, 94], + [210, 210, 210], [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], - [255, 253, 253], - [253, 121, 121], - [121, 228, 228], + [255, 255, 255], + [253, 253, 253], + [121, 121, 121], + [228, 228, 228], [228, 228, 228], - [228, 121, 121], - [121, 253, 253], - [253, 255, 255], + [121, 121, 121], + [253, 253, 253], [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], - [255, 210, 210], - [210, 94, 94], - [94, 239, 239], - [239, 255, 255], + [255, 255, 255], + [210, 210, 210], + [94, 94, 94], + [239, 239, 239], ], [ - [255, 252, 252], - [252, 100, 100], - [100, 234, 234], - [234, 255, 255], + [255, 255, 255], + [252, 252, 252], + [100, 100, 100], + [234, 234, 234], [255, 255, 255], [255, 255, 255], - [255, 254, 254], - [254, 250, 250], - [250, 255, 255], [255, 255, 255], - [255, 245, 245], - [245, 170, 170], + [254, 254, 254], + [250, 250, 250], + [255, 255, 255], + [255, 255, 255], + [245, 245, 245], + [170, 170, 170], [170, 170, 170], - [170, 245, 245], - [245, 255, 255], + [245, 245, 245], [255, 255, 255], - [255, 250, 250], - [250, 254, 254], - [254, 255, 255], [255, 255, 255], + [250, 250, 250], + [254, 254, 254], [255, 255, 255], - [255, 233, 233], - [233, 99, 99], - [99, 252, 252], + [255, 255, 255], + [255, 255, 255], + [233, 233, 233], + [99, 99, 99], ], [ - [252, 157, 157], - [157, 198, 198], - [198, 255, 255], + [252, 252, 252], + [157, 157, 157], + [198, 198, 198], + [255, 255, 255], + [255, 255, 255], [255, 255, 255], [255, 255, 255], + [187, 187, 187], + [39, 22, 22], + [147, 138, 138], + [248, 248, 248], [255, 255, 255], - [255, 187, 187], - [187, 39, 22], - [22, 147, 138], - [138, 248, 248], - [248, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], - [255, 248, 248], - [248, 147, 138], - [138, 39, 22], - [22, 187, 187], - [187, 255, 255], + [248, 248, 248], + [147, 138, 138], + [39, 22, 22], + [187, 187, 187], [255, 255, 255], [255, 255, 255], [255, 255, 255], - [255, 197, 197], - [197, 158, 158], + [255, 255, 255], + [197, 197, 197], ], [ - [158, 108, 108], - [108, 255, 255], + [158, 158, 158], + [108, 108, 108], + [255, 255, 255], + [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], + [252, 252, 252], + [188, 0, 0], + [105, 27, 27], + [217, 217, 217], + [234, 234, 234], + [228, 228, 228], + [216, 216, 216], + [105, 27, 27], + [188, 0, 0], + [68, 33, 33], + [252, 252, 252], + [255, 255, 255], [255, 255, 255], - [255, 252, 252], - [252, 68, 33], - [33, 188, 0], - [0, 105, 27], - [27, 217, 217], - [217, 234, 234], - [234, 228, 228], - [228, 216, 216], - [216, 105, 27], - [27, 188, 0], - [0, 68, 33], - [33, 252, 252], - [252, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], - [255, 109, 109], ], [ - [109, 110, 110], - [110, 150, 150], - [150, 255, 255], + [109, 109, 109], + [110, 110, 110], + [150, 150, 150], + [255, 255, 255], + [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], + [195, 195, 195], + [88, 2, 2], + [144, 0, 0], + [172, 172, 172], + [80, 80, 80], + [16, 16, 16], + [168, 168, 168], + [144, 0, 0], + [88, 2, 2], + [196, 196, 196], [255, 255, 255], - [255, 195, 195], - [195, 88, 2], - [2, 144, 0], - [0, 172, 172], - [172, 80, 80], - [80, 16, 16], - [16, 168, 168], - [168, 144, 0], - [0, 88, 2], - [2, 196, 196], - [196, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], - [255, 150, 150], - [150, 110, 110], + [150, 150, 150], ], [ - [110, 71, 71], - [71, 92, 92], - [92, 255, 255], + [110, 110, 110], + [71, 71, 71], + [92, 92, 92], [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], - [255, 183, 183], - [183, 191, 191], - [191, 255, 255], - [255, 14, 14], - [14, 0, 0], - [0, 204, 204], - [204, 190, 190], - [190, 183, 183], - [183, 255, 255], + [255, 255, 255], + [183, 183, 183], + [191, 191, 191], + [255, 255, 255], + [14, 14, 14], + [0, 0, 0], + [204, 204, 204], + [190, 190, 190], + [183, 183, 183], [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], - [255, 92, 92], - [92, 71, 71], + [255, 255, 255], + [92, 92, 92], ], [ - [71, 255, 255], - [255, 127, 127], - [127, 255, 255], + [71, 71, 71], + [255, 255, 255], + [127, 127, 127], [255, 255, 255], [255, 255, 255], [255, 255, 255], @@ -245,11 +245,11 @@ [255, 255, 255], [255, 255, 255], [255, 255, 255], - [255, 235, 235], - [235, 0, 0], + [255, 255, 255], + [235, 235, 235], + [0, 0, 0], [0, 0, 0], - [0, 149, 149], - [149, 255, 255], + [149, 149, 149], [255, 255, 255], [255, 255, 255], [255, 255, 255], @@ -257,136 +257,136 @@ [255, 255, 255], [255, 255, 255], [255, 255, 255], - [255, 125, 125], - [125, 255, 255], + [255, 255, 255], + [125, 125, 125], ], [ [255, 255, 255], - [255, 121, 121], - [121, 251, 251], - [251, 255, 255], + [255, 255, 255], + [121, 121, 121], + [251, 251, 251], + [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], - [255, 202, 202], - [202, 0, 0], + [202, 202, 202], [0, 0, 0], - [0, 106, 106], - [106, 255, 255], + [0, 0, 0], + [106, 106, 106], + [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], - [255, 251, 251], - [251, 121, 121], - [121, 255, 255], + [251, 251, 251], + [121, 121, 121], ], [ [255, 255, 255], - [255, 176, 176], - [176, 185, 185], - [185, 255, 255], + [255, 255, 255], + [176, 176, 176], + [185, 185, 185], + [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], - [255, 204, 204], - [204, 0, 0], + [204, 204, 204], [0, 0, 0], - [0, 77, 77], - [77, 255, 255], + [0, 0, 0], + [77, 77, 77], + [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], - [255, 183, 183], - [183, 178, 178], - [178, 255, 255], + [183, 183, 183], + [178, 178, 178], ], [ [255, 255, 255], - [255, 252, 252], - [252, 118, 118], - [118, 224, 224], - [224, 112, 112], - [112, 255, 255], + [255, 255, 255], + [252, 252, 252], + [118, 118, 118], + [224, 224, 224], + [112, 112, 112], [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], - [255, 145, 145], - [145, 108, 108], - [108, 212, 212], - [212, 255, 255], [255, 255, 255], + [145, 145, 145], + [108, 108, 108], + [212, 212, 212], [255, 255, 255], [255, 255, 255], [255, 255, 255], - [255, 112, 112], - [112, 224, 224], - [224, 117, 117], - [117, 252, 252], - [252, 255, 255], + [255, 255, 255], + [255, 255, 255], + [112, 112, 112], + [224, 224, 224], + [117, 117, 117], + [252, 252, 252], ], [ [255, 255, 255], [255, 255, 255], - [255, 199, 199], - [199, 60, 60], - [60, 171, 171], - [171, 167, 167], - [167, 255, 255], - [255, 235, 235], - [235, 204, 204], - [204, 239, 239], - [239, 255, 255], + [255, 255, 255], + [199, 199, 199], + [60, 60, 60], + [171, 171, 171], + [167, 167, 167], + [255, 255, 255], + [235, 235, 235], + [204, 204, 204], + [239, 239, 239], [255, 255, 255], [255, 255, 255], [255, 255, 255], - [255, 239, 239], - [239, 204, 204], - [204, 235, 235], - [235, 255, 255], - [255, 167, 167], - [167, 172, 172], - [172, 60, 60], - [60, 199, 199], - [199, 255, 255], + [255, 255, 255], + [239, 239, 239], + [204, 204, 204], + [235, 235, 235], + [255, 255, 255], + [167, 167, 167], + [172, 172, 172], + [60, 60, 60], + [199, 199, 199], [255, 255, 255], ], [ [255, 255, 255], [255, 255, 255], [255, 255, 255], - [255, 197, 197], - [197, 255, 255], - [255, 125, 125], - [125, 197, 197], - [197, 91, 91], - [91, 54, 54], - [54, 219, 219], - [219, 255, 255], [255, 255, 255], + [197, 197, 197], + [255, 255, 255], + [125, 125, 125], + [197, 197, 197], + [91, 91, 91], + [54, 54, 54], + [219, 219, 219], [255, 255, 255], [255, 255, 255], - [255, 218, 218], - [218, 54, 54], - [54, 91, 91], - [91, 196, 196], - [196, 126, 126], - [126, 255, 255], - [255, 197, 197], - [197, 255, 255], + [255, 255, 255], + [255, 255, 255], + [218, 218, 218], + [54, 54, 54], + [91, 91, 91], + [196, 196, 196], + [126, 126, 126], + [255, 255, 255], + [197, 197, 197], [255, 255, 255], [255, 255, 255], ], @@ -396,21 +396,21 @@ [255, 255, 255], [255, 255, 255], [255, 255, 255], - [255, 254, 254], - [254, 119, 119], - [119, 71, 71], - [71, 194, 194], - [194, 245, 245], - [245, 255, 255], + [255, 255, 255], + [254, 254, 254], + [119, 119, 119], + [71, 71, 71], + [194, 194, 194], + [245, 245, 245], [255, 255, 255], [255, 255, 255], [255, 255, 255], - [255, 245, 245], - [245, 194, 194], - [194, 71, 71], - [71, 119, 119], - [119, 254, 254], - [254, 255, 255], + [255, 255, 255], + [245, 245, 245], + [194, 194, 194], + [71, 71, 71], + [119, 119, 119], + [254, 254, 254], [255, 255, 255], [255, 255, 255], [255, 255, 255], @@ -424,17 +424,17 @@ [255, 255, 255], [255, 255, 255], [255, 255, 255], - [255, 153, 153], - [153, 117, 117], - [117, 255, 255], + [255, 255, 255], + [153, 153, 153], + [117, 117, 117], + [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], [255, 255, 255], - [255, 116, 116], - [116, 153, 153], - [153, 255, 255], + [116, 116, 116], + [153, 153, 153], [255, 255, 255], [255, 255, 255], [255, 255, 255], diff --git a/robot.py b/robot.py index 21fa2333..fc725aed 100755 --- a/robot.py +++ b/robot.py @@ -238,6 +238,14 @@ def testPeriodic(self): if self.driver_joystick.getTriggerPressed(): self.shooter.fire() + if self.driver_joystick.getRawButtonPressed(10): + if not self.led_screen.animating: + self.led_screen.animate() + else: + self.led_screen.setup() + self.led_screen.animating = False + self.led_screen.execute() + if __name__ == "__main__": wpilib.run(MyRobot)