Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Program execution stops at u8g2.begin(); when using MegaCoreX #2105

Open
RMCybernetics opened this issue Feb 18, 2023 · 1 comment
Open

Program execution stops at u8g2.begin(); when using MegaCoreX #2105

RMCybernetics opened this issue Feb 18, 2023 · 1 comment

Comments

@RMCybernetics
Copy link

RMCybernetics commented Feb 18, 2023

Seems an identical issue to #1750
However I am using an ATMega4808 with MegaCoreX. Could the issue be with u8g2 as the previous person had the same issue with a totally different board?

Example code;

#include <Wire.h>
#include <U8g2lib.h>

#define LED 1

U8G2_SH1106_128X64_NONAME_F_HW_I2C u8g2{U8G2_R0, /* reset=*/ U8X8_PIN_NONE};

void setup() {

	pinMode(LED,OUTPUT);

  Wire.begin(0x7A);             // <----  Without this line, execution stops at u8g2.begin()
  u8g2.setI2CAddress(0x7A);			// 0x3D
	Wire.pins(10,11);
  
	u8g2.begin();
	u8g2.clearBuffer();					      // clear the diplay
	u8g2.setFont(u8g2_font_5x8_mf);		// 5x8 pixel font

  // Put something on the screen
  u8g2.drawStr(10, 10, "TEST");     // Nothing is on the screen :(
  u8g2.sendBuffer();
}

void loop() {

    digitalWrite(LED,HIGH); // Turn on an LED to show program is running

}
@olikraus
Copy link
Owner

Not sure what I can do here. Doesn't seem to be a u8g2 problem.
Maybe you missed pull up resistors?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants