Due to high demand expect some shipping delays at this time, orders may not ship for 1-2 business days.
0

Make a special helper module for a screen
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Make a special helper module for a screen

by MikeB35 on Sun Oct 17, 2021 11:22 am

Hello everyone,

I would like to create a display class in a separate file.
It would include : the definition of the SPI bus, the implementation of the
the display driver (here ST7735R) and the creation of a group of
displayio group.
I would like to be able to import this class in different files
and use the group indifferently in each file.
Do you think this is possible?
How would I go about it to get a fairly clean code?
And especially to avoid that when importing the class, the bus
is not recreated and avoid errors like "ValueError : GPxx
in use" errors.

Thanks in advance for your help,

Mike

MikeB35
 
Posts: 59
Joined: Thu Feb 05, 2015 10:18 am

Please be positive and constructive with your questions and comments.