Make a special helper module for a screen

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
AmazingCircuitPythonFR35
 
Posts: 99
Joined: Thu Feb 05, 2015 10:18 am

Make a special helper module for a screen

Post by AmazingCircuitPythonFR35 »

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

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”