karawin / Ka-Radio

A wifi webradio with only low cost boards ESP8266 and VS1053 by Jp Cocatrix
Other
428 stars 91 forks source link

karadioU8STM32 - redefinition of 'U8GLIB_SSD1306_128X64 u8g' #96

Open Zinci opened 3 years ago

Zinci commented 3 years ago

After I successfully flashed couple of ESP8266, I continued to try and connect the I2C 0.9" 128X64 OLED display. This calls for a STM32 board. I do have these boards but never even opened them. Anyway after "having fun" loading bootloader through FTD1232 so I can actually connect to the STM32 through USB and upload the Arduino sketch I stumbled on another hurdle of installing the libraries. The explanation on where to get the libraries is found in u8glibConf.h file of each LCD configuration and is documented very clear. The real trouble began when Arduino compiler came up with an error:

error: redefinition of 'U8GLIB_SSD1306_128X64 u8g'

I was able to get rid of this error by editing the u8glibConf.h file and commenting the lines 47, 48 and 49 where U8GLIB_SSD1306_128X64 u8g is defined (it is already defined in karadioU8STM32.ino file). After this, apart from few warnings about labels not used the sketch compiled and uploaded into STM32. It is working now, albeit still on a breadboard. I am writing this for anyone trying this particular configuration and to document my work-flow. I do not know if this is the right and correct approach, but it worked for me.

karawin commented 3 years ago

Yes a last minute change. I will see the problem soon. Thanks