Go Down

Topic: IDE can't find appropriate .h file (Read 89 times) previous topic - next topic

dnfh9

Nov 21, 2020, 07:52 pm Last Edit: Nov 21, 2020, 07:52 pm by dnfh9
Trying to use IDE 1.8.13 on a MacAir with Heltec ESP32 Wifi with display, and trying to find out how to write to the display. Board is installed and shows up under Arduino-Tools-Board; Arduino-File-Examples has lots of examples for this board. They work correctly, but don't seem to have one for writing to the display.
On Instructables I found "WiFi Kit 32 NTP Clock" which looked suuitable. I downloaded the file which is named FSF1ZYUJCKUISHC.ino

The code starts:
<
#include                              <time.h>                              // for time calculations
#include                              <WiFi.h>                              // for wifi
#include                              <WiFiUdp.h>                           // for udp via wifi
#include                              <U8g2lib.h>   
>
It seems I need a U8g2lib library, which I tried to get using Tools-Library Manager. This appeared to work and places lots of files in Documents-Arduino-Libraries-U8g2. But trying to run any of the examples gives the error "
Arduino: 1.8.13 (Mac OS X), Board: "Heltec WiFi Kit 32, Disabled, Default, 240MHz (WiFi/BT), QIO, 40MHz, 4MB (32Mb), 921600, None"
Multiple libraries were found for "WiFi.h"
FSF1ZYUJCKUISHC:41:135: fatal error: U8g2lib.h: No such file or directory
compilation terminated.
Used: /Users/dnfharris/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/WiFi
Not used: /private/var/folders/b5/kgvw_ck570v4wb33q9h3txpr0000gn/T/AppTranslocation/695C1F0A-3477-4A6C-9A97-0C5BDB1FC8E7/d/Arduino.app/Contents/Java/libraries/WiFi
exit status 1
U8g2lib.h: No such file or directory
"

I assume some path is wrong? Or was it that I haven't got any ZIP file to install with Sketch-Include Library-Add .Zip Library, as per your guide?
Apologies if I am doing something silly!

pert

On Instructables I found "WiFi Kit 32 NTP Clock" which looked suuitable.
Please post a link to it.

I assume some path is wrong?
From the information you providided, I can't see any problems.

Please try compiling this minimal sketch:
Code: [Select]
#include <U8g2lib.h>
void setup() {}
void loop() {}

Do you get an error?

Or was it that I haven't got any ZIP file to install with Sketch-Include Library-Add .Zip Library, as per your guide?
What guide?

dnfh9

[Apologies, I don't know how to format this reply to look like yours! My comments in italics]

Please post a link to it.
    https://www.instructables.com/WiFi-Kit-32-NTP-Clock/#discuss

From the information you providided, I can't see any problems.

Please try compiling this minimal sketch:
Code: [Select]
#include <U8g2lib.h>
void setup() {}
void loop() {}

Do you get an error?

       Yes, same error, even though there IS a U8g2lib.h there. I suspect the problem is I don't seem to have the U8g2 actual library, just the header (I couldn't find the .zip file to download), since other library installs using "Sketch-Include Library-Add .Zip library" worked fine. Is that the likely problem?

What guide?
Apologies, it was Adafruit's guide on installing libraries:
https://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use/how-to-install-a-library





dnfh9

Sorry, problem solved. It WAS missing the library, and I managed to find the Heltec Zip file for the library. Once installed through the Library manager, all is working!

pert

I'm glad to hear it's working now. Thank you for taking the time to post an update. Enjoy!
Per

Go Up