0

Displayio and terminalio libs
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Displayio and terminalio libs

by GaryMinor on Mon Mar 22, 2021 10:25 am

I'm using the 128x32 display and the example code imports displayio and terminalio.
Where do i find the libraries?

GaryMinor
 
Posts: 6
Joined: Mon Mar 22, 2021 10:13 am

Re: Displayio and terminalio libs

by adafruit_support_carter on Mon Mar 22, 2021 1:25 pm

Those are both "core" libraries. So they are written in C and are found in the circuitpython source code repo:
https://github.com/adafruit/circuitpython

adafruit_support_carter
 
Posts: 19700
Joined: Tue Nov 29, 2016 2:45 pm

Re: Displayio and terminalio libs

by GaryMinor on Mon Mar 22, 2021 10:59 pm

At the terminal, I entered:
wget github.com/adafruit/circuitpython

It responded with several lines, ending with:
Saving to: 'circuitpython'

However, import displayio still can't find displayio.

Should I be doing something different?

I did download the entire package. I extracted it and see a lib directory. Where do I put it?

GaryMinor
 
Posts: 6
Joined: Mon Mar 22, 2021 10:13 am

Re: Displayio and terminalio libs

by jamesybanana2234 on Tue Mar 23, 2021 8:47 am

Hi adafruit,

I bought the HDMI 5" display backpack on March 18, 2021 (order number: 2516858-9773430922). It was delivered in the mail yesterday. I'm using a raspiberry pi 4 with it but it won't display the screen, only a white background with a black line on the bottom. I know the pi's display is resized to the correct dimensions and my other research into the issue makes me believe it's an issue with the backpack that I got itself. I emailed adafruit support after the issue and they said to post my issue on the forum here. I haven't done anything to the backpack besides open it from the box and plug in the usb and hdmi. I don't want a refund but a replacement or be able to fix the issue without messing with it too much because I need it for a project for my school.

Thanks for your help
Attachments
unnamed (3).jpg
front of display backpack
unnamed (3).jpg (972.19 KiB) Viewed 113 times
unnamed (4).jpg
back of display backpack
unnamed (4).jpg (915.39 KiB) Viewed 113 times
unnamed (2).jpg
screen issue when on
unnamed (2).jpg (968.44 KiB) Viewed 113 times

jamesybanana2234
 
Posts: 2
Joined: Tue Mar 23, 2021 8:30 am

Re: Displayio and terminalio libs

by adafruit_support_carter on Tue Mar 23, 2021 10:15 am

@jamesybanana2234 Please start a new thread for your issue.

adafruit_support_carter
 
Posts: 19700
Joined: Tue Nov 29, 2016 2:45 pm

Re: Displayio and terminalio libs

by adafruit_support_carter on Tue Mar 23, 2021 10:18 am

You can't import the libraries that way. Sorry, wasn't sure what you were looking for.

Different boards have different capabilities and therefore different sets of the core libraries are including in their respective firmwmare (the circuitpython uf2 file). The matrix of what supports what is here:
https://circuitpython.readthedocs.io/en ... atrix.html

What board are you using?

adafruit_support_carter
 
Posts: 19700
Joined: Tue Nov 29, 2016 2:45 pm

Re: Displayio and terminalio libs

by GaryMinor on Tue Mar 23, 2021 10:35 am

Thanks for your response.

I'm using Raspbian on the Raspberry Pi 4, 8Gig.
I see that the Raspberry Pico is on the list.

Since it is I2C interface, I expected that drivers for the Raspbian (Python) would be available.

GaryMinor
 
Posts: 6
Joined: Mon Mar 22, 2021 10:13 am

Re: Displayio and terminalio libs

by adafruit_support_carter on Tue Mar 23, 2021 11:10 am

The Pico is very different from other Raspberry Pi boards. A Pi 4 can run a full linux based operating system. A Pico is more like a microcontroller and only runs one program at a time. But that "one program" could be the CircuitPython firmware.

For a Pi 4, checkout this guide:
https://learn.adafruit.com/circuitpytho ... x/overview

adafruit_support_carter
 
Posts: 19700
Joined: Tue Nov 29, 2016 2:45 pm

Re: Displayio and terminalio libs

by GaryMinor on Wed Mar 24, 2021 10:40 pm

Thanks,

That guide seems to be just what I need. I haven't read all of it yet.... I may be back with more questions.

Gary

GaryMinor
 
Posts: 6
Joined: Mon Mar 22, 2021 10:13 am

Re: Displayio and terminalio libs

by GaryMinor on Sat Mar 27, 2021 1:47 pm

The device that I have is a Adafruit Featherwing OLED - 128 x 64 Add-on For Feather display (4650). When I bought it, I really didn’t know much about the different devices or code that was needed to support it.

I want to use it with my Raspberry Pi-4 and Raspbian. It uses the I2C interface and since I had used my Raspberry Pi-4 to interface with other I2C devices, I figured this would work.

Thanks for your response where you suggested that I look at:
Overview | CircuitPython on Linux and Raspberry Pi | Adafruit Learning System.
There I found this encouraging phrase.
The upshot is that any code we have for CircuitPython will be instantly and easily runnable on Linux computers like Raspberry Pi.
In particular, we'll be able to use all of our device drivers - the sensors, led controllers, motor drivers, HATs, bonnets, etc. And nearly all of these use I2C or SPI!

I have performed all of the operations described, ending with the install of raspi-blinka.py. I can run blinkatest.py successfully.

I don’t have the devices used in the examples, but I have successfully used other I2C devices with the pi-4.

I have Adafruit_CircuitPython_DisplayIO_SH1107-main folder on my pi-4. Inside that folder is the file adafruit_displayio_sh1107.py. When I run that file, I get:
ModuleNotFoundError: No module named ‘displayio’
Other example code imports displayio and terminalio.

Therefore, my original question:
Where do I find the libraries?

And your original answer:
Those are both "core" libraries. So they are written in C and are found in the circuitpython source code repo:
https://github.com/adafruit/circuitpython

From that site I downloaded the package and found these files:

circuitpython-main/ports/atmel-samd/common-hal/displayio/ParallelBus.c
circuitpython-main/ports/atmel-samd/common-hal/displayio/ParallelBus.h
circuitpython-main/shared-bindings/terminalio/Terminal.c
circuitpython-main/shared-bindings/terminalio/Terminal.h

This is encouraging, but I don’t know what to do next.

GaryMinor
 
Posts: 6
Joined: Mon Mar 22, 2021 10:13 am

Re: Displayio and terminalio libs

by Kangus on Sat Mar 27, 2021 7:55 pm

I have the same issue, I forked circuitpython to WSL2 ubuntu 20.04 and looked at building displayio and terminalio.. I can build them as part of a 'board' but not as .mpy or py files, way past my skill set.

Adafruit has displays, a lot of them, for the Raspberry PI https://www.adafruit.com/product/3531 128X64 OLED and they have python drivers but the OLED Feather uses a different driver. Checkout https://www.adafruit.com/product/3527 $7.99

With the PI there are libraries for most of the displays and display vendors add examples for their displays, the FT232H, not so much but that isn't what I purchased the FT232H for anyway.

Kangus
 
Posts: 38
Joined: Sat May 19, 2018 10:01 pm

Re: Displayio and terminalio libs

by adafruit_support_carter on Mon Mar 29, 2021 2:21 pm

In general, you don't want anything from here:
https://github.com/adafruit/circuitpython
unless you are doing core development work.

Using the FeatherWing with the Pi will be a bit of a kluge, since it was meant to be used with a Feather main board.

For the software part, to get the library, try installing the library via pip:
https://circuitpython.readthedocs.io/pr ... -from-pypi

adafruit_support_carter
 
Posts: 19700
Joined: Tue Nov 29, 2016 2:45 pm

Re: Displayio and terminalio libs

by Kangus on Thu Apr 01, 2021 4:12 pm

"Using the FeatherWing with the Pi "
What would be good is a FT232H on a Featherwing PCB to be used to test Featherwings. Plug a FT232H Featherwing into a FeatherQUAD and you have a means to test wings from Ubuntu ... More options, more widgets to sell.

Kangus
 
Posts: 38
Joined: Sat May 19, 2018 10:01 pm

Please be positive and constructive with your questions and comments.