olikraus / u8glib

Arduino Monochrom Graphics Library for LCDs and OLEDs
https://github.com/olikraus/u8glib/wiki
Other
1.24k stars 313 forks source link

SSD1306 128X64 working in Arduino and not in Atmel Studio 7 #463

Open Pop48m opened 7 years ago

Pop48m commented 7 years ago

I have used successfully used u8glib for a number of projects in Arduino environment with both the UNO and Mega boards. The connections from my OLED 128X64 to Mega2560 are as follows; D0 - 52 (SCK) D1 - 51 (MOSI) CS - 37 DC - 36 RST - 35 In Arduino, I have succesfully used the constructors: U8GLIB_SSD1306_128X64 u8g(52, 51, 37, 36, 35); for software SPI U8GLIB_SSD1306_128X64 u8g(37, 36, 35); for hardware SPI In Atmel Studio, for the same connections, I have used the constructors (for Mega2560 board): u8g_InitSPI(&u8g, &u8g_dev_ssd1306_128x64_sw_spi, PN(1, 1), PN(1, 2), PN(2, 0), PN(2, 1), PN(2, 2)); u8g_InitHWSPI(&u8g, &u8g_dev_ssd1306_128x64_hw_spi, PN(2, 0), PN(2, 1), PN(2, 2)); but, the display is always blank. Also, during compilation I got two warnings: Warning (near initialization for 'u8g_dev_rot.dev_fn') OLED_Hello C:\Users\Pop\Documents\Atmel Studio\7.0\ArduinoMEGA\OLED_Hello\OLED_Hello\u8g_rot.c 48 Warning initialization from incompatible pointer type OLED_Hello C:\Users\Pop\Documents\Atmel Studio\7.0\ArduinoMEGA\OLED_Hello\OLED_Hello\u8g_rot.c 48 The line 48 in u8g_rot.c is: u8g_dev_t u8g_dev_rot = { u8g_dev_rot_dummy_fn, NULL, NULL };

olikraus commented 7 years ago

I think the warning can be ignored.

I have not tested u8glib for a long time....hmmmm..