From 8ab3b69a159e1b0fc2e7e90b32e0d480c0ee9985 Mon Sep 17 00:00:00 2001 From: Drew Bednar Date: Mon, 26 Aug 2024 21:52:00 -0400 Subject: [PATCH] Saving for pico --- .gitignore | 3 ++- NOTES.md | 1 + demo_bouncing_boxes.py | 15 +++++++++++++-- 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 NOTES.md diff --git a/.gitignore b/.gitignore index 7a13564..d73ba78 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ .ftpconfig .vscode/ main.py -ftp.py \ No newline at end of file +ftp.py +env/ diff --git a/NOTES.md b/NOTES.md new file mode 100644 index 0000000..91ce05e --- /dev/null +++ b/NOTES.md @@ -0,0 +1 @@ +SPI Video https://www.youtube.com/watch?v=suCTwxlYgnM diff --git a/demo_bouncing_boxes.py b/demo_bouncing_boxes.py index f53e122..9cbfa20 100644 --- a/demo_bouncing_boxes.py +++ b/demo_bouncing_boxes.py @@ -79,8 +79,16 @@ def test(): """Bouncing box.""" try: # Baud rate of 40000000 seems about the max - spi = SPI(1, baudrate=40000000, sck=Pin(14), mosi=Pin(13)) - display = Display(spi, dc=Pin(4), cs=Pin(16), rst=Pin(17)) + spi = SPI(0, + baudrate=10000000, # pico 10Mhz + polarity=1, # what voltage level to set the clock signal to when in standby mode (not sending data) + phase=1, # Tells SPI wether it needs to sample data on first or second edge of the clock value. + bits=8, # Sets bits per data value + firstbit=SPI.MSB, # In which order should multiple byte data be sent. LCD panel expects Big Endian. So Most significant byte first + sck=Pin(18), + mosi=Pin(19), + miso=Pin(16)) # in this data you aren't sending any data back. + display = Display(spi, dc=Pin(15), cs=Pin(17), rst=Pin(14)) display.clear() colors = [color565(255, 0, 0), @@ -106,5 +114,8 @@ def test(): except KeyboardInterrupt: display.cleanup() +for i in range(0, 10, -1): + print(f"Starting in: {i}") + sleep_us(1000000) test()