From 6c2f8ca25057e9a82940462c7661617b3de00d7b Mon Sep 17 00:00:00 2001 From: rdagger Date: Thu, 18 Jun 2020 18:17:26 -0700 Subject: [PATCH] Revise demos to match video wiring --- demo_bouncing_boxes.py | 2 +- demo_color_palette.py | 2 +- demo_color_wheel.py | 2 +- demo_colored_squares.py | 2 +- demo_fonts.py | 2 +- demo_images.py | 2 +- demo_scrolling_marquee.py | 8 ++++---- demo_shapes.py | 2 +- demo_sprite.py | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/demo_bouncing_boxes.py b/demo_bouncing_boxes.py index 74c59ba..f53e122 100644 --- a/demo_bouncing_boxes.py +++ b/demo_bouncing_boxes.py @@ -79,7 +79,7 @@ def test(): """Bouncing box.""" try: # Baud rate of 40000000 seems about the max - spi = SPI(2, baudrate=40000000, sck=Pin(18), mosi=Pin(23)) + spi = SPI(1, baudrate=40000000, sck=Pin(14), mosi=Pin(13)) display = Display(spi, dc=Pin(4), cs=Pin(16), rst=Pin(17)) display.clear() diff --git a/demo_color_palette.py b/demo_color_palette.py index 84be897..86d3b15 100644 --- a/demo_color_palette.py +++ b/demo_color_palette.py @@ -44,7 +44,7 @@ def hsv_to_rgb(h, s, v): def test(): """Test code.""" # Baud rate of 40000000 seems about the max - spi = SPI(2, baudrate=40000000, sck=Pin(18), mosi=Pin(23)) + spi = SPI(1, baudrate=40000000, sck=Pin(14), mosi=Pin(13)) display = Display(spi, dc=Pin(4), cs=Pin(16), rst=Pin(17)) c = 0 diff --git a/demo_color_wheel.py b/demo_color_wheel.py index cc906e9..9a54055 100644 --- a/demo_color_wheel.py +++ b/demo_color_wheel.py @@ -52,7 +52,7 @@ def hsv_to_rgb(h, s, v): def test(): """Test code.""" # Baud rate of 40000000 seems about the max - spi = SPI(2, baudrate=40000000, sck=Pin(18), mosi=Pin(23)) + spi = SPI(1, baudrate=40000000, sck=Pin(14), mosi=Pin(13)) display = Display(spi, dc=Pin(4), cs=Pin(16), rst=Pin(17)) x, y = 0, 0 diff --git a/demo_colored_squares.py b/demo_colored_squares.py index 575b87b..c04f136 100644 --- a/demo_colored_squares.py +++ b/demo_colored_squares.py @@ -34,7 +34,7 @@ WHITE = const(0XFFF) # (255, 255, 255) def test(): """Test code.""" # Baud rate of 40000000 seems about the max - spi = SPI(2, baudrate=40000000, sck=Pin(18), mosi=Pin(23)) + spi = SPI(1, baudrate=40000000, sck=Pin(14), mosi=Pin(13)) display = Display(spi, dc=Pin(4), cs=Pin(16), rst=Pin(17)) # Build color list from all upper case constants (lazy approach) diff --git a/demo_fonts.py b/demo_fonts.py index fc790d4..e304d37 100644 --- a/demo_fonts.py +++ b/demo_fonts.py @@ -8,7 +8,7 @@ from xglcd_font import XglcdFont def test(): """Test code.""" # Baud rate of 40000000 seems about the max - spi = SPI(2, baudrate=40000000, sck=Pin(18), mosi=Pin(23)) + spi = SPI(1, baudrate=40000000, sck=Pin(14), mosi=Pin(13)) display = Display(spi, dc=Pin(4), cs=Pin(16), rst=Pin(17)) print('Loading fonts...') diff --git a/demo_images.py b/demo_images.py index d4c5bc3..4b58ed9 100644 --- a/demo_images.py +++ b/demo_images.py @@ -7,7 +7,7 @@ from machine import Pin, SPI def test(): """Test code.""" # Baud rate of 40000000 seems about the max - spi = SPI(2, baudrate=40000000, sck=Pin(18), mosi=Pin(23)) + spi = SPI(1, baudrate=40000000, sck=Pin(14), mosi=Pin(13)) display = Display(spi, dc=Pin(4), cs=Pin(16), rst=Pin(17)) display.draw_image('images/RaspberryPiWB128x128.raw', 0, 0, 128, 128) diff --git a/demo_scrolling_marquee.py b/demo_scrolling_marquee.py index c02889f..1a532fb 100644 --- a/demo_scrolling_marquee.py +++ b/demo_scrolling_marquee.py @@ -22,7 +22,7 @@ def test(): dc_pin = Pin(4) rst_pin = Pin(17) # Baud rate of 40000000 seems about the max - spi = SPI(2, baudrate=40000000, sck=Pin(18), mosi=Pin(23)) + spi = SPI(1, baudrate=40000000, sck=Pin(14), mosi=Pin(13)) # Create the ILI9341 display: display = Display(spi, dc=dc_pin, cs=cs_pin, rst=rst_pin) @@ -33,12 +33,12 @@ def test(): display.fill_rectangle(0, 168, 239, 151, color565(220, 27, 72)) # Load Marquee image - display.draw_image('images\Rototron128x26.raw', 56, 120, 128, 26) + display.draw_image('images/Rototron128x26.raw', 56, 120, 128, 26) # Set up scrolling - display.set_scroll(top=100, bottom=152) + display.set_scroll(top=152, bottom=100) - spectrum = list(range(100, 153)) + list(reversed(range(100, 153))) + spectrum = list(range(152, 221)) + list(reversed(range(152, 220))) while True: for y in spectrum: display.scroll(y) diff --git a/demo_shapes.py b/demo_shapes.py index bf81a6c..6ce8ae2 100644 --- a/demo_shapes.py +++ b/demo_shapes.py @@ -7,7 +7,7 @@ from machine import Pin, SPI def test(): """Test code.""" # Baud rate of 40000000 seems about the max - spi = SPI(2, baudrate=40000000, sck=Pin(18), mosi=Pin(23)) + spi = SPI(1, baudrate=40000000, sck=Pin(14), mosi=Pin(13)) display = Display(spi, dc=Pin(4), cs=Pin(16), rst=Pin(17)) display.clear(color565(64, 0, 255)) diff --git a/demo_sprite.py b/demo_sprite.py index 8660439..6b67fbe 100644 --- a/demo_sprite.py +++ b/demo_sprite.py @@ -91,7 +91,7 @@ def test(): """Bouncing sprite.""" try: # Baud rate of 40000000 seems about the max - spi = SPI(2, baudrate=40000000, sck=Pin(18), mosi=Pin(23)) + spi = SPI(1, baudrate=40000000, sck=Pin(14), mosi=Pin(13)) display = Display(spi, dc=Pin(4), cs=Pin(16), rst=Pin(17)) display.clear()