import os
import board
import digitalio
import busio
import storage
import sdcardio

print("Hello, Pi Pico!")
print("Showing our files in '/'", os.listdir("/"), sep=" - ")
print("Showing only Python files:", [filename for filename in os.listdir("/") if filename.endswith(".py")])
print("Showing os.uname()", os.uname(), sep=" - ")

# Initialize the SPI interface
spi = busio.SPI(board.GP10, MOSI=board.GP11, MISO=board.GP12)

# Initialize the SD card
cs = board.GP13
# sdcard = sdcardio.SDCard(spi, cs)

# # Mount the SD card
# vfs = storage.VfsFat(sdcard)
# storage.mount(vfs, "/sd")

# # List the files
# print("Files on SD card:")
# print(os.listdir("/sd"))

# Initialize the I2C interface
i2c = busio.I2C(board.GP15, board.GP14) # fails here

import adafruit_ssd1306
# Initialize the display
display = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c)

# Clear the display
display.fill(0)
display.show()

# Display some text
display.text("Hello, Pi Pico!", 0, 0, 1)
display.show()
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT