lexus2k / lcdgfx

Driver for LCD displays running on Arduino/Avr/ESP32/Linux (including Rasperry) platforms
MIT License
356 stars 51 forks source link

ESP32 C3 #68

Closed elgerg closed 2 years ago

elgerg commented 2 years ago

Hi,

Does (or will) this library support the ESP32 C3 or S2?

Thanks!

lexus2k commented 2 years ago

Hi,

Are you experiencing any issues with compiling the library for ESP32-C3? The library uses standard i2c and spi interfaces, so I expect it to work on any ESP32 hardware chip.

Best regards

elgerg commented 2 years ago

It compiles fine but I cant figure out what pins to use :(. Any ideas?

lexus2k commented 2 years ago

@elgerg It depends on the display type.

elgerg commented 2 years ago

Its a MSP1503 1.5" OLED 128x128 I2C display if that helps? I need to know what pins to map from SDA and SCL.. Thanks!

lexus2k commented 2 years ago

By default the library uses I2C_NUM_1 on ESP32 platform, the default pins are:

On the DevKit ESP32-C you have maybe those pins are SDA D19 and SCL D18. That should be specified in the datasheet for your devboard. You can point out the exact pin numbers to the constructor of SSD1306 class, by passing SPlatformI2cConfig structure.

elgerg commented 2 years ago

Thanks for that. Do you have any examples of passing in SPlatformI2cConfig?

The C2 only has one I2C bus. I'm not 100% sure if I2C_NUM_1 will work or not..

elgerg commented 2 years ago

According to this: https://freematics.com/store/index.php?route=product/product&product_id=100 IO4 and IO5 are used for I2C but I suspect that any pins can be used.

lexus2k commented 2 years ago

If you are using Arduiono just remember, that IO pin numbers are not the same as digital pin numbers in Arduino environment.

elgerg commented 2 years ago

Yes, of course.

According to this: https://esp32.com/viewtopic.php?t=20070 Any pins can be used for I2C as long as they are not input only.

Do you have an example of passing in the SPlatformI2cConfig structure?

Thanks

lexus2k commented 2 years ago
DisplaySSD1306_128x64_I2C display(-1, {-1, 0, SCL_PIN_NUM, SDA_PIN_NUM, 0});
elgerg commented 2 years ago

Hi,

So I gave that a go and ended up no further.

Can you tell me what address it's trying to write to? My display is currently set to 0x78 but can be changed to 0x7a.

Thanks Alex

elgerg commented 2 years ago

Ok, it might be that the documentation that specifies what IO > ardiono pin numbers doesnt exist or i'm just doing something wrong. I just cant seem to get it to work.

I did think that the pins were right as IO3 and IO4 are the red and green RGB led pins but i still cant seem to get it to work.

Could the addresses (0x78 and 0x7a) be wrong?

Any help would really be appreciated.

If it would help I can arrange for a dev board to be shipped out to you?

lexus2k commented 2 years ago

Can you tell me what address it's trying to write to? My display is currently set to 0x78 but can be changed to 0x7a.

You need to pass i2c address to SPlatformI2cConfig structure: https://codedocs.xyz/lexus2k/lcdgfx/struct_s_platform_i2c_config.html

I believe it should be either 0x3C (0x78 / 2) or 0x3D (0x7a / 2). But you need to check against the datasheet.

I did think that the pins were right as IO3 and IO4 are the red and green RGB led pins but i still cant seem to get it to work.

So, do you say that D3, D4 don't work for you ?

If it would help I can arrange for a dev board to be shipped out to you?

Of course, you can, but it will take around 1 month for the board to get here.

ITstreet1 commented 2 years ago

For ESP32-C3, I2C should be IO8 and IO9.

elgerg commented 2 years ago

Testing with another screen/board.

Will let you know the outcome as soon as I can..