Search found 4 matches

by derkomai
Thu Apr 16, 2020 6:13 am
Forum: ESP8266 boards
Topic: D1 mini 0.66" OLED and I2C buttons
Replies: 5
Views: 4886

Re: D1 mini 0.66" OLED and I2C buttons

jimmo wrote:
Tue Apr 14, 2020 5:57 am
derkomai wrote:
Sat Apr 11, 2020 11:55 am
- Send i2c command GET_KEY_VALUE (0x04)
derkomai wrote:
Sat Apr 11, 2020 11:55 am
i2c.writeto(49, b'4') # returns 1, so I get 1 ACK, correct.
These two are not the same thing.

b'4' is 0x34 (i.e. the ascii code for the '4' character). You want to use b'\x04'
Yes, hat was it, thak you for your help!
by derkomai
Tue Apr 14, 2020 8:00 am
Forum: ESP8266 boards
Topic: D1 mini 0.66" OLED and I2C buttons
Replies: 5
Views: 4886

Re: D1 mini 0.66" OLED and I2C buttons

jimmo wrote:
Tue Apr 14, 2020 5:57 am
derkomai wrote:
Sat Apr 11, 2020 11:55 am
- Send i2c command GET_KEY_VALUE (0x04)
derkomai wrote:
Sat Apr 11, 2020 11:55 am
i2c.writeto(49, b'4') # returns 1, so I get 1 ACK, correct.
These two are not the same thing.

b'4' is 0x34 (i.e. the ascii code for the '4' character). You want to use b'\x04'
Oh, thanks! I'll give it a try later.
by derkomai
Sat Apr 11, 2020 11:55 am
Forum: ESP8266 boards
Topic: D1 mini 0.66" OLED and I2C buttons
Replies: 5
Views: 4886

Re: D1 mini 0.66" OLED and I2C buttons

from machine import Pin, I2C i2c = I2C(scl=Pin(5), sda=Pin(4), freq=400000) print(i2c.scan()) # returns [49, 60] as expected i2c.writeto(49, b'4') # returns 1, so I get 1 ACK, correct. i2c.readfrom(49, 1) # returns \x02, or \x02\xff\xff\xff\xff\xff\xff\xff if I read more bytes This is the code I'm ...
by derkomai
Sun Apr 05, 2020 5:47 pm
Forum: ESP8266 boards
Topic: D1 mini 0.66" OLED and I2C buttons
Replies: 5
Views: 4886

D1 mini 0.66" OLED and I2C buttons

Hi everyone. I'm new over here and I'm fiddling with a Lolin D32 mini and the following 0.66" OLED screen with 2 x I2C buttons: https://docs.wemos.cc/en/latest/d1_mini_shiled/oled_0_66.html After a few hours trying to make the two buttons work and looking for some docs, I'm starting to think that ma...