Over the SPI interface, you can communicate with various devices using the Minnowboard. In this notebook, you can communicate with a wide variety of TFT LCD screens. You can find some examples such as these two displays:
In [ ]:
# Get the Python Imaging Libraries for drawing shapes and working with images
import Image
import ImageDraw
import ImageFont
# Get our driver and GPIO libraries
import pyDrivers.ILI9341 as TFT
import Adafruit_GPIO.GPIO as GPIO
import Adafruit_GPIO.SPI as SPI
# Minnowboard MAX configuration.
DC = 25
RST = 26
SPI_PORT = 0
SPI_DEVICE = 0
In [ ]:
# Create TFT LCD display class.
disp = TFT.ILI9341(DC, rst=RST, spi=SPI.SpiDev(SPI_PORT, SPI_DEVICE, max_speed_hz=1000000))
# Initialize display.
disp.begin()
# Clear the display to a red background.
# Can pass any tuple of red, green, blue values (from 0 to 255 each).
disp.clear((255, 0, 0))
# Get a PIL Draw object to start drawing on the display buffer.
draw = disp.draw()
In [ ]:
draw.rectangle((10, 90, 110, 160), outline=(255,255,0), fill=(0,0,255))
# Write buffer to the screen
disp.display()
In [ ]:
image = Image.open('logo.png')
image = image.rotate(90).resize((240,320))
disp.display(image)