ramapcsx2 / gbs-control

GNU General Public License v3.0
771 stars 110 forks source link

Arduino E (98) i2c: i2c_set_pin(875): scl gpio number error #479

Open Sorin-Jayaweera opened 11 months ago

Sorin-Jayaweera commented 11 months ago

Hello, I am using Arduino IDE 2.1.1 on Windows. I have no issues writing to my ssd1306 screen on esp-wroom-32 devboard with the defauld SDA(21) and SCl(22). However, I also want to use the screen on an ESP32C3 devboard -- which doesn't have set i2c pins but supposedly can use any pins. For this, I defined displaySDA as pin 0 and displaySCL as pin 1 and then initialize. However, this brings up the error E (98) i2c: i2c_set_pin(875): scl gpio number error. What do you think the error could be? I am not finding the error codes (which i assume the E 98 is) for this library. Is this error code from the board?

the c3 board is "Teyleten Robot ESP32-C3-DevKitM-1 ESP32-C3 Development Board Core Board Serial WiFi Bluetooth Module WiFi+BTLE 5.0 Module Type-C for Arduino" https://www.amazon.com/gp/product/B0B6HT7L9L/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

again, it works perfectly with the espwroom 32 on pins 21/22 but I'm not seeing it work on the c3. It is most likely the board, but I wanted to get your input. Thank you!

#define displaySDA 0
#define displaySCL 10

SSD1306Wire display(0x3c, displaySDA, displaySCL);

//in setup
 display.init();
Serial.println("begun Screen");

  display.setTextAlignment(TEXT_ALIGN_LEFT);
  display.flipScreenVertically();
  display.setFont(ArialMT_Plain_10);
  display.clear();
  display.drawString(0,15,"hello world");
  display.display();
nyanpasu64 commented 11 months ago

Are you building a GBS-Control? This project currently supports ESP8266 only as far as I know, and cannot offer support for using SSD1306Wire as a library outside of how GBS-Control uses it (and changes you want to make to GBS-C).