Hello all, I'm using an HT16k33 matrix board along with several 7 segment displays. Because there isn't a library to display beyond 4 numbers, I mapped out segments using the matrix function. My question is how can I tell CircuitPython to import definitions saved as definition.py file into the main code.py. For example here is a definition for 0.
Code: Select all
def zero():
matrix[x,0] = 1
matrix[x,1] = 1
matrix[x,2] = 1
matrix[x,3] = 1
matrix[x,4] = 1
matrix[x,5] = 1
I can't import directly because I'll get an error that says 'matrix' is not defined in the definition.py while 'matrix' is defined in code.py. I want to separate definitions from the main program so it won't be excessively long. If I leave the definitions in the main program, everything works just fine.