Arduino include problems

Hi,

I'm going round in circles with Arduino libraries. Some code won't compile because of incorrect libraries, so I emptied all Arduino stuff, plus uninstalled Arduino. Then reinstalled it and tried again.

The libraries involve the screen, gps etc. I'm not a coder, and am using AI in the best way I can. This saves me keep asking forums for help, which can be annoying for you all.

Previously, I've worked though data sheets, and got PICs to use GPS, screens and other peripherals using SPI, which make a very long program. I have been badgered to use INCLUDES, which do work, and save lots of time, but they are behind the scenes, so it very difficult to check where problems lie. I used to learn my programs (more or less) so having no INCLUDEs weren't much of a problems.

Is there a way to write programs with no INCLUDEs?

C

  • Sure, put all the code/files necessary in your project folder.
    Files with .ino extensions are compiled together.

Your other topic on the same subject deleted.

Please do not duplicate your questions as doing so wastes the time and effort of the volunteers trying to help you as they are then answering the same thing in different places.

Please create one topic only for your question and choose the forum category carefully. If you have multiple questions about the same project then please ask your questions in the one topic as the answers to one question provide useful context for the others, and also you won’t have to keep explaining your project repeatedly.

Repeated duplicate posting could result in a temporary or permanent ban from the forum.

Could you take a few moments to Learn How To Use The Forum

It will help you get the best out of the forum in the future.

Thank you.

Please post a sketch that does not compile and the full error message that you get. Use code tags for both when posting them

Did it help?

Libraries are convenient but sometimes necessary to communicate with your devices. Having an external library makes your code clean to read by referencing only needed parts of the library.

  • Copy the library filename, for example: blink.h
  • Search on blink.h and follow the link to the library. Blink/Blink.h at master · Arduino-CI/Blink · GitHub
  • In the .H file, you will see what the library uses when called.
  • in the .CPP file of the library, you will see the functions of the library.
  • You will also have a /examples directory to understand how the author wrote the library to be used.
  • Inside your IDE, when you have a question of a library function, "right-click" your mouse on the function and select "Go to definition"

Libraries have a ... library ... of information contained within.

Hi B,

The other thread was closed through lack of use..

C

Hi X,

Since posting this, I tried the AI again, and it found an error in the library. Where it said PlusPlus it should have been Plus and in the library was an extra file, which needed to be deleted. This got the sketch to compile.

For me this is pretty complicated, and it's only luck and repetition, that I can sometimes succeed with this type of problem.

As you can see by the earlier comment, things take me a long time to get working.

Thanks,

C.

What library? Bracccio? GitHub - arduino-libraries/Arduino_Braccio_plusplus · GitHub

"Lack of interest."

Lack of use waits for six months of inactivity, then auto-closes.

Did it help?

Hi X,

I am unable to program, and previously I used a couple of forums, where 'I' was able to do amazing things with PICs, from members from all around the world. I had to abandon the main project after approx 6 years. I started this much smaller project, since I found AIs, which allows someone like me who has coding difficulies, to carry on with this interesting hobby.

C

It just takes time, as you have shown. Ask any question.

Think of all the amazing things you could do if you learned to program !

Hi X,

It is the Heltec ESP32 libraries.

C

That sounds more like a board file than a library. If so you do not #include it in a sketch, rather you install it in the Arduino IDE

Better than that, if you use IDE 2.x then you probably do not have to install anything since ESP32 support is already present

Please provide a link to the library that you had problems with

Hi B,

It may be more sensible, if I say the libraries for Heltec 32 V3. I use a Ublox GPS as an input, and I've tried different selections of library, but it's never been quite straight forward. I had it almost working with heltec_unofficial.h and TinyGPSPlus. I don't think its straight forward, as perhaps versions on units and library changes make the combination not so easy.

C

No, not realistically. Unless you want to write GPS and display code from scratch.

Without seeing your full sketch and error messages it is not possible to give you any definitive help

You will not get a solution if you don't post code and error messages (please use code tags as described in https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum/679966#posting-code-and-common-code-problems).

I know that you did find a solution but your solution might bite you later; e.g. in another project where the file that you deleted or renamed is needed.

In case you feel that you will embarrass yourself when posting your code, don't feel embarrassed. We have all made clumsy mistakes in our learning process.

The only way you will learn is by showing, asking and accepting the given advice; most helpers here are quite gentle when it comes to helping so don't be afraid.

Your use of AI might also shoot you in the foot; it will provide a solution that might or might not work. You might not learn anything from it if you're the type of person that e.g. just drops suggested code in a project instead of analysing how it's working.
If you do analyse provided solutions and understand them it's okay to use the provided solution(s); if you don't understand them, don't use them.

Hi W,

I looked at some old pic code, of an abandoned long project, and I cans see why I abandoned it (It was long and complicated and was 'doing my head in') So I can see why includes are used, but because I can't see them, then something doesn't work, is it in my visual code or the includes.

Simply I'm not a good programmer, and look for the easiest way, which of course is never simple ;)

C

Hi S,

There are 3x codes all talking to each other, with peripherals, that work in myserious way, so I have to 'feel' my way through this project.

I'm not embarrased to post code, but I'm aware of time and effort wasting.

In order to test what I'm doing you would need 3x Heltec v3s.

'aI' got one end to work yesterday, and will work on the other two.

I'll post the codes later.

C