B4R Question Adafruit_SH1106.cpp Error! How can I solve this?

Cableguy

Expert
Licensed User
Longtime User
Hi guys...

Coming back to electronics after being out for a long while, surely bites ones as*!!
I just spent 2h truing to make any example work on any of my 3 ESP boards!
I finally managed to make a working combo, with a NodeMCU 12E and a SSD1306 LCD!
Now I would like to make my remaining boards (1 Wemos Mini D1 and 1 ESP32 Dev Kit) work with my remaining LCD, an SH1106!

This has always been a pain to work with, but it seems that something has changed, either in the Arduino Lib (my best bet) either on the B4r Wrapper...but it seems unchanged since launch!

So, I get the following error when trying to compile!

B4X:
BouncingBall\B4R\Objects\src\Adafruit_SH1106.cpp:31:11: fatal error: util/delay.h: No such file or directory
   31 |  #include <util/delay.h>

And the message is NOT wrong! In fact in the mentioned file I see the following block:

B4X:
#include <avr/pgmspace.h>
#ifndef __SAM3X8E__
 #include <util/delay.h>
#endif
#include <stdlib.h>

#include <Wire.h>

#include "Adafruit_GFX.h"
#include "Adafruit_SH1106.h"

When I try to run some Arduino (.ino) files that target the same base lib of which our wrapper is based, I also get this:

B4X:
c:\Users\psapg\Documents\Arduino\libraries\VEGA_SH1106\Adafruit_SH1106.cpp:31:11: fatal error: util/delay.h: No such file or directory
   31 |  #include <util/delay.h>

As you can see, the "#include util/delay.h" is inside an IF block... that I think is not met!
So how can I bypass this?
I have tried to change the lib file and delete the constraining block, but it gets overwritten upon compilation.
Seems like something has changed in the Original Arduino derived lib for this lcd...


Any hints?
 
Last edited:

Cableguy

Expert
Licensed User
Longtime User
I tried that, didn't work.
However, a code module, targeting a diferent lib worked very well... once I finish it I will release it
 
Upvote 0
Top