The code presents a socket interface and controls various devices on the i2c bus.
Instead of a socket I just used input and stdout
The package structure and imports was flawless, I was expecting all sorts of issues but none
Logging was a problem so I used micropython.lib logging code.
A couple of points
I used warn which wasnt implemented (warning is)
logging.getLogger() didnt have a default positional arg
Log class doesnt implement setLevel - easy to add
I also used the collections.deque which was fine
would be nice to have clear() tho
The main gotcha was the time.time() function which I used in my Uart millisecond timeouts.
In python3 world this returned a double with the fractional seconds on the pyboard this is just an integer.
The help command used "{0:<12} {1}".format( key, d[key].help[0]) which wasn't formatted correctly.
so I just used
Code: Select all
def rpad(s, width):
return s + ' ' * (width-len(s))