I wrote this piece of code that implements small driving computer for moped with originally broken display.
It get's speed from hall sensor, and ignition from capacitive wire from spark plug. Before I refactored from my scratch code into cleaner python class code it worked somewhat. But now after refactoring I don't get it to start even. I get this:
Code: Select all
repl ~ import mopo ~ mopo.show() Entering REPL. Use Control-X to exit. > MicroPython v1.14 on 2021-02-02; ESP module with ESP8266 Type "help()" for more information. >>> >>> import mopo ; mopo.show() Traceback (most recent call last): File "<stdin>", line 1, in <module> MemoryError:
Would anyone be kind enough to have a look what kinda mistakes I make there?
This is a learning path for me, and my son. I used to do C programming for years loooong time ago, and have written small python stuff to do simple stuff. But I'm still quite a beginner to python.
Some things that I wonder...
- * I tried to do FOO = const(XX), but none of those work, so I removed the const stuff
* I perhaps should add underscore to the beginning of class internal variables.
* Interrupts worked before doing classes by using global variables, but I'm not sure now with classes, if the format is right.
* Why on earth won't it even load?
I would really appreciate on some lessons here