Tell that to someone who downloads a library or driver "for MicroPython" and gets errors like these. Look at Adafruit's CircuitPython — it is still the same language, but they changed the name to avoid confusion, because they have different API for the peripherals. I'm not saying you have to change the name, but it would make it much easier to also write libraries for your version, and clearly mark them as running on your version — by using the name of the runtime in the library's name. Right now how I would do that? "loboris' MicroPython"?loboris wrote:What makes MicroPython "MicroPython" is the core of the Python language implementation, at least it is my understanding...
OLED mini-display for ESP32
Re: OLED mini-display for ESP32
Re: OLED mini-display for ESP32
@deshipu
What you say makes sense. I'll try to maintain the compatibility with MicroPython.
At the moment I'm writting the documentation for all the changes and new/modified modules specific to this port. I'm aware that at this time it is hard to use/test it without knowing what exactly has been added/changed and why.
Thank you for your comments.
What you say makes sense. I'll try to maintain the compatibility with MicroPython.
At the moment I'm writting the documentation for all the changes and new/modified modules specific to this port. I'm aware that at this time it is hard to use/test it without knowing what exactly has been added/changed and why.
Thank you for your comments.
Re: OLED mini-display for ESP32
Ran into the next problem (with "loboris' MicroPython" - rest works very well):
dir(i2c) indeed only lists writeto and writeto_mem.
scan shows the device ([60]) as expected, and I also can communicate with other I2C devices (tried MPU9250).
Code: Select all
File "ssd1306.py", line 1198, in write_data
AttributeError: 'I2C' object has no attribute 'write'
scan shows the device ([60]) as expected, and I also can communicate with other I2C devices (tried MPU9250).
Bernhard Boser
Re: OLED mini-display for ESP32
There is a bug in frozen module ssd1306.py.ttmetro wrote: ↑Thu Oct 19, 2017 5:03 amRan into the next problem (with "loboris' MicroPython" - rest works very well):dir(i2c) indeed only lists writeto and writeto_mem.Code: Select all
File "ssd1306.py", line 1198, in write_data AttributeError: 'I2C' object has no attribute 'write'
scan shows the device ([60]) as expected, and I also can communicate with other I2C devices (tried MPU9250).
Please edit components/micropython/esp32/modules/ssd1306.py and change:
Code: Select all
def write_data(self, buf):
self.temp[0] = self.addr << 1
self.temp[1] = 0x40 # Co=0, D/C#=1
self.i2c.write(self.temp)
self.i2c.write(buf)
Code: Select all
def write_data(self, buf):
temp1 = bytearray(1)
temp1[0] = 0x40 # Co=0, D/C#=1
self.i2c.writeto(self.addr, temp1+buf)
I'm working on implementation of primitive I2C functions start, stop, write, readinto for ESP32 hardware I2C.
It will be available soon.