Hey @crosswick & @giuliomoro
Trying to get an OLED display to work based on the repo @giuliomoro posted in reply #30 (https://github.com/giuliomoro/bela-ssd1306) and I'm actually getting the following warnings and a runide error:
Build finished
In file SSD1306_OLED.c: [warning] passing 'const unsigned char *' to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign] column: 33, line: 2419
In file SSD1306_OLED.c: [warning] passing 'char [3]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign] column: 22, line: 2430
In file SSD1306_OLED.c: [warning] passing 'const unsigned char *' to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign] column: 30, line: 2442
In file SSD1306_OLED.c: [warning] passing 'char [3]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign] column: 20, line: 2443
In file SSD1306_OLED.c: [warning] passing 'char *' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign] column: 22, line: 2479
In file SSD1306_OLED.c: [warning] passing 'char [4]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign] column: 26, line: 2657
In file SSD1306_OLED.c: [warning] passing 'char [4]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign] column: 26, line: 2659
In file SSD1306_OLED.c: [warning] passing 'char [4]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign] column: 26, line: 2661
In file SSD1306_OLED.c: [warning] passing 'char [4]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign] column: 26, line: 2663
In file SSD1306_OLED.c: [warning] passing 'char [2]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign] column: 24, line: 2686
In file example_app.c: [warning] passing 'char [7]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign] column: 15, line: 261
In file example_app.c: [warning] passing 'char [14]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign] column: 15, line: 286
In file example_app.c: [warning] passing 'char [3]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign] column: 15, line: 293
In file example_app.c: [warning] passing 'char [19]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign] column: 17, line: 377
In file example_app.c: [warning] passing 'char [21]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign] column: 17, line: 379
In file example_app.c: [warning] passing 'char [10]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign] column: 17, line: 382
/root/Bela/projects/bela-ssd1306/SSD1306_OLED.c:2419:33: warning: passing 'const unsigned char *' to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
return print(strPtr, strlen(strPtr));
^~~~~~
/usr/include/string.h:394:35: note: passing argument to parameter '__s' here
extern size_t strlen (const char *__s)
^
/root/Bela/projects/bela-ssd1306/SSD1306_OLED.c:2430:22: warning: passing 'char [3]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
return print_str("\r\n");
^~~~~~
/root/Bela/projects/bela-ssd1306/SSD1306_OLED.c:2417:38: note: passing argument to parameter 'strPtr' here
short print_str(const unsigned char *strPtr)
^
/root/Bela/projects/bela-ssd1306/SSD1306_OLED.c:2442:30: warning: passing 'const unsigned char *' to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
n = print(strPtr, strlen(strPtr));
^~~~~~
/usr/include/string.h:394:35: note: passing argument to parameter '__s' here
extern size_t strlen (const char *__s)
^
/root/Bela/projects/bela-ssd1306/SSD1306_OLED.c:2443:20: warning: passing 'char [3]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
n += print_str("\r\n");
^~~~~~
/root/Bela/projects/bela-ssd1306/SSD1306_OLED.c:2417:38: note: passing argument to parameter 'strPtr' here
short print_str(const unsigned char *strPtr)
^
/root/Bela/projects/bela-ssd1306/SSD1306_OLED.c:2479:22: warning: passing 'char *' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
return print_str(str);
^~~
/root/Bela/projects/bela-ssd1306/SSD1306_OLED.c:2417:38: note: passing argument to parameter 'strPtr' here
short print_str(const unsigned char *strPtr)
^
/root/Bela/projects/bela-ssd1306/SSD1306_OLED.c:2657:26: warning: passing 'char [4]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
return print_str("nan");
^~~~~
/root/Bela/projects/bela-ssd1306/SSD1306_OLED.c:2417:38: note: passing argument to parameter 'strPtr' here
short print_str(const unsigned char *strPtr)
^
/root/Bela/projects/bela-ssd1306/SSD1306_OLED.c:2659:26: warning: passing 'char [4]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
return print_str("inf");
^~~~~
/root/Bela/projects/bela-ssd1306/SSD1306_OLED.c:2417:38: note: passing argument to parameter 'strPtr' here
short print_str(const unsigned char *strPtr)
^
/root/Bela/projects/bela-ssd1306/SSD1306_OLED.c:2661:26: warning: passing 'char [4]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
return print_str("ovf"); // constant determined empirically
^~~~~
/root/Bela/projects/bela-ssd1306/SSD1306_OLED.c:2417:38: note: passing argument to parameter 'strPtr' here
short print_str(const unsigned char *strPtr)
^
/root/Bela/projects/bela-ssd1306/SSD1306_OLED.c:2663:26: warning: passing 'char [4]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
return print_str("ovf"); // constant determined empirically
^~~~~
/root/Bela/projects/bela-ssd1306/SSD1306_OLED.c:2417:38: note: passing argument to parameter 'strPtr' here
short print_str(const unsigned char *strPtr)
^
/root/Bela/projects/bela-ssd1306/SSD1306_OLED.c:2686:24: warning: passing 'char [2]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
n += print_str(".");
^~~
/root/Bela/projects/bela-ssd1306/SSD1306_OLED.c:2417:38: note: passing argument to parameter 'strPtr' here
short print_str(const unsigned char *strPtr)
^
10 warnings generated.
/root/Bela/projects/bela-ssd1306/example_app.c:261:15: warning: passing 'char [7]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
print_str("scroll");
^~~~~~~~
/root/Bela/projects/bela-ssd1306/SSD1306_OLED.h:172:45: note: passing argument to parameter 'strPtr' here
extern short print_str(const unsigned char *strPtr);
^
/root/Bela/projects/bela-ssd1306/example_app.c:286:15: warning: passing 'char [14]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
print_str("HELLO FELLAS!");
^~~~~~~~~~~~~~~
/root/Bela/projects/bela-ssd1306/SSD1306_OLED.h:172:45: note: passing argument to parameter 'strPtr' here
extern short print_str(const unsigned char *strPtr);
^
/root/Bela/projects/bela-ssd1306/example_app.c:293:15: warning: passing 'char [3]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
print_str("0x");
^~~~
/root/Bela/projects/bela-ssd1306/SSD1306_OLED.h:172:45: note: passing argument to parameter 'strPtr' here
extern short print_str(const unsigned char *strPtr);
^
/root/Bela/projects/bela-ssd1306/example_app.c:377:17: warning: passing 'char [19]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
print_strln("deeplyembedded.org");
^~~~~~~~~~~~~~~~~~~~
/root/Bela/projects/bela-ssd1306/SSD1306_OLED.h:174:47: note: passing argument to parameter 'strPtr' here
extern short print_strln(const unsigned char *strPtr);
^
/root/Bela/projects/bela-ssd1306/example_app.c:379:17: warning: passing 'char [21]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
print_strln("Author:Vinay Divakar");
^~~~~~~~~~~~~~~~~~~~~~
/root/Bela/projects/bela-ssd1306/SSD1306_OLED.h:174:47: note: passing argument to parameter 'strPtr' here
extern short print_strln(const unsigned char *strPtr);
^
/root/Bela/projects/bela-ssd1306/example_app.c:382:17: warning: passing 'char [10]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
print_strln("THANK YOU");
^~~~~~~~~~~
/root/Bela/projects/bela-ssd1306/SSD1306_OLED.h:174:47: note: passing argument to parameter 'strPtr' here
extern short print_strln(const unsigned char *strPtr);
^
6 warnings generated.
Running project...
(Main)i2c-2: Bus Connected to SSD1306
Makefile:524: recipe for target 'runide' failed
make: *** [runide] Error 1
I also want to just confirm the correct pin connections and I2C bus to be using when using the files in the repo linked above. It seemed at the beginning of the thread that it made most sense to connect to the I2C1 bus, but I noticed in the terminal that it says "(Main)i2c-2: Bus Connected to SSD1306" - so I'm also wondering whether I'm connecting to the wrong bus.
My breadboard is currently set up with a Bela Mini like this:
Ground: P2_21
VIN: P2_23
SCL: P2_9
SDA: P2_11
Is this correct? Or should I be using I2C2? i.e.:
Ground: P2_21
VIN: P2_23
SCL: P1_26
SDA: P1_28
Per @crosswick's note concerning the RST pin - I'm using the circuit noted here:
http://community.axoloti.com/t/spi-i2c-oled-display/638/187
Specifically - I've got a 10k resistor connected to the 3.3V rail, a 68nf cap connected to ground - I'm running a wire at the junction point on the terminal strip where the 10k resistor meets the 68nf cap to another terminal strip where a 100k resistor is tied to ground and I have a wire from that strip connected to the RST pin.
Is this the correct way to deal with the RST pin? I've seen other examples where RST is connected to a GPIO pin - but there doesn't appear to be an RST pin noted in the code anywhere and it isn't mentioned in this thread explicitly either.
Just trying to get this example code running so I can move on to some more fun visuals!