UART inheritance mystery
Posted: Thu Nov 29, 2018 9:10 am
A "What a Terrible Failure"-moment (a.k.a WTF) for me...
I am developing a set of classes to be used with terminals. I am deriving from UART as follows:
The objective is, to create an object with the port and speed, and the lines and columns the terminal has.
I this example, port 6, speed 9600 baud, 80 columns and 25 lines. The last two values shall be stored in the serialTerminal object.
However, what happens, is this:
What am I overlooking here? Thanks for your help.
I am developing a set of classes to be used with terminals. I am deriving from UART as follows:
Code: Select all
from pyb import UART
class serialTerminal(UART):
def __init__(self,port,speed,maxCol,maxRow):
self.maxCol = maxCol
self.maxRow = maxRow
troubleTerminal = serialTerminal(6,9600,80,25) # this is line 61
I this example, port 6, speed 9600 baud, 80 columns and 25 lines. The last two values shall be stored in the serialTerminal object.
However, what happens, is this:
I have read the documentation about inheritance in Python, also about usage of super and __init__. And i also invested hours in searching Google, but so far I don't understand, why the system obviously passes on the maxCol and maxRow parameters to the base class.Traceback (most recent call last):
File "main.py", line 61, in <module>
ValueError: unsupported combination of bits and parity
MicroPython v1.9.2 on 2017-08-23; PYBv1.1 with STM32F405RG
What am I overlooking here? Thanks for your help.