Search found 8 matches

by Blechi
Thu Feb 13, 2020 11:45 pm
Forum: General Discussion and Questions
Topic: How to combine bytearrays fast ?
Replies: 14
Views: 6872

Re: How to combine bytearrays fast ?

The data for each of the four LED colors is a 240 bytes window of the same bytearray which is quite a bit longer than the 240 bytes. The four windows slide along this array at different speeds in a way that keeps the 0 bytes at the same position for each basic color array. This is faster than calcul...
by Blechi
Thu Feb 13, 2020 4:40 pm
Forum: General Discussion and Questions
Topic: How to combine bytearrays fast ?
Replies: 14
Views: 6872

Re: How to combine bytearrays fast ?

Wow, this is really impressive. I can't believe that this can be done so fast. This @micropython.native def merge(a, b, c, d, result): for i in range(0,240): result[i] = a[i] + b[i] + c[i] + d[i] return(result) is about 7 times faster than this for i in range(0,240): result[i] = a[i] + b[i] * c[i] +...
by Blechi
Wed Feb 12, 2020 9:30 pm
Forum: General Discussion and Questions
Topic: How to combine bytearrays fast ?
Replies: 14
Views: 6872

How to combine bytearrays fast ?

Hi folks, I'm a little stuck here and maybe someone can help. There are four bytearrays which have to be combined (for lack of a better word) into a fifth one using the fastest way possible. a = bytearray(240) b = bytearray(240) c = bytearray(240) d = bytearray(240) result = bytearray(240) a = [<arb...
by Blechi
Tue May 01, 2018 8:00 pm
Forum: Drivers for External Components
Topic: TinyRTC I2C Module DS1307 + AT24C32N
Replies: 13
Views: 12272

Re: TinyRTC I2C Module DS1307 + AT24C32N

That was the right hint.
In the Loboris port the read and write functions require adrlen = 2 instead of addrsize = 16 .
After changing that everything works fine.
Thank you all for your help.
by Blechi
Sun Apr 29, 2018 1:40 pm
Forum: Drivers for External Components
Topic: TinyRTC I2C Module DS1307 + AT24C32N
Replies: 13
Views: 12272

Re: TinyRTC I2C Module DS1307 + AT24C32N

Thank you for the reply. Notepad++ had eaten the 4 empty lines in the license terms. After having fixed that by downloading the latest version from https://github.com/mcauser/micropython-tinyrtc-i2c the result is: i2c scan: [80, 104, 118] Traceback (most recent call last): File "<stdin>", line 7, in...
by Blechi
Fri Apr 27, 2018 9:12 pm
Forum: Drivers for External Components
Topic: TinyRTC I2C Module DS1307 + AT24C32N
Replies: 13
Views: 12272

Re: TinyRTC I2C Module DS1307 + AT24C32N

Hi, thank you for the drivers. DS1307 works like a charm. The AT24C32N however doesn't do what it's supposed to do: On my TTGO ESP32 boards (latest loboris port) when i enter this: import machine i2c = machine.I2C(scl=machine.Pin(22), sda=machine.Pin(21)) print('i2c scan:',i2c.scan()) import at24c32...
by Blechi
Fri Apr 27, 2018 12:38 pm
Forum: Drivers for External Components
Topic: BME280 driver that works with ESP32?
Replies: 2
Views: 6052

Re: BME280 driver that works with ESP32?

Thank you very much for your reply.
Copying the BME280.py into the modules directory and building it as a frozen module did the trick.
Now it works fine.
Thank you again.
by Blechi
Mon Apr 23, 2018 6:50 pm
Forum: Drivers for External Components
Topic: BME280 driver that works with ESP32?
Replies: 2
Views: 6052

BME280 driver that works with ESP32?

Hi, i'm trying to interface an ESP32 board (TT GO, latest loboris port) with a bme280 sensor (I2C, temperature, humidity, barometric pressure). I couldn't find a driver for ESP32 so i tried the next best thing, which was catdo2's driver for the esp8266 (https://github.com/catdog2/mpy_bme280_esp8266)...