This worked:
After it failed a number of times with this:debian@beaglebone:~$ sudo apt install build-essential python-dev python-setuptools python-pip python-smbus -y
Where and how do I get the PIL library?Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='www.piwheels.org', port=443): Read timed out. (read timeout=15)",)': /simple/adafruit-bbio/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', error(0, 'Error'))': /simple/adafruit-bbio/
Code: Select all
# Copyright (c) 2014 Adafruit Industries
# Author: Tony DiCola
# Header text removed since it contained banned words.
#
from PIL import Image
import Adafruit_ILI9341 as TFT
import Adafruit_GPIO as GPIO
import Adafruit_GPIO.SPI as SPI
# Raspberry Pi configuration.
#DC = 18
#RST = 23
#SPI_PORT = 0
#SPI_DEVICE = 0
# BeagleBone Black configuration.
DC = 'P9_15'
RST = 'P9_12'
SPI_PORT = 1
SPI_DEVICE = 0
# Create TFT LCD display class.
disp = TFT.ILI9341(DC, rst=RST, spi=SPI.SpiDev(SPI_PORT, SPI_DEVICE, max_speed_hz=64000000))
# Initialize display.
disp.begin()
# Load an image.
FileName = 'ORING_YVR_SMALL.jpg'
print('Loading image...'+FileName)
image = Image.open(FileName)
# Resize the image and rotate it so it's 240x320 pixels.
image = image.rotate(90).resize((240, 320))
# Draw the image on the display hardware.
print('Drawing image')
disp.display(image)