Revise demos to match video wiring

pull/4/head
rdagger 5 years ago
parent 072f3e2832
commit 6c2f8ca250

@ -79,7 +79,7 @@ def test():
"""Bouncing box.""" """Bouncing box."""
try: try:
# Baud rate of 40000000 seems about the max # 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 = Display(spi, dc=Pin(4), cs=Pin(16), rst=Pin(17))
display.clear() display.clear()

@ -44,7 +44,7 @@ def hsv_to_rgb(h, s, v):
def test(): def test():
"""Test code.""" """Test code."""
# Baud rate of 40000000 seems about the max # 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 = Display(spi, dc=Pin(4), cs=Pin(16), rst=Pin(17))
c = 0 c = 0

@ -52,7 +52,7 @@ def hsv_to_rgb(h, s, v):
def test(): def test():
"""Test code.""" """Test code."""
# Baud rate of 40000000 seems about the max # 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 = Display(spi, dc=Pin(4), cs=Pin(16), rst=Pin(17))
x, y = 0, 0 x, y = 0, 0

@ -34,7 +34,7 @@ WHITE = const(0XFFF) # (255, 255, 255)
def test(): def test():
"""Test code.""" """Test code."""
# Baud rate of 40000000 seems about the max # 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 = Display(spi, dc=Pin(4), cs=Pin(16), rst=Pin(17))
# Build color list from all upper case constants (lazy approach) # Build color list from all upper case constants (lazy approach)

@ -8,7 +8,7 @@ from xglcd_font import XglcdFont
def test(): def test():
"""Test code.""" """Test code."""
# Baud rate of 40000000 seems about the max # 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 = Display(spi, dc=Pin(4), cs=Pin(16), rst=Pin(17))
print('Loading fonts...') print('Loading fonts...')

@ -7,7 +7,7 @@ from machine import Pin, SPI
def test(): def test():
"""Test code.""" """Test code."""
# Baud rate of 40000000 seems about the max # 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 = Display(spi, dc=Pin(4), cs=Pin(16), rst=Pin(17))
display.draw_image('images/RaspberryPiWB128x128.raw', 0, 0, 128, 128) display.draw_image('images/RaspberryPiWB128x128.raw', 0, 0, 128, 128)

@ -22,7 +22,7 @@ def test():
dc_pin = Pin(4) dc_pin = Pin(4)
rst_pin = Pin(17) rst_pin = Pin(17)
# Baud rate of 40000000 seems about the max # 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: # Create the ILI9341 display:
display = Display(spi, dc=dc_pin, cs=cs_pin, rst=rst_pin) 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)) display.fill_rectangle(0, 168, 239, 151, color565(220, 27, 72))
# Load Marquee image # 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 # 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: while True:
for y in spectrum: for y in spectrum:
display.scroll(y) display.scroll(y)

@ -7,7 +7,7 @@ from machine import Pin, SPI
def test(): def test():
"""Test code.""" """Test code."""
# Baud rate of 40000000 seems about the max # 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 = Display(spi, dc=Pin(4), cs=Pin(16), rst=Pin(17))
display.clear(color565(64, 0, 255)) display.clear(color565(64, 0, 255))

@ -91,7 +91,7 @@ def test():
"""Bouncing sprite.""" """Bouncing sprite."""
try: try:
# Baud rate of 40000000 seems about the max # 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 = Display(spi, dc=Pin(4), cs=Pin(16), rst=Pin(17))
display.clear() display.clear()

Loading…
Cancel
Save