How do I bring a .h or .cpp into the ide so I can read the code?
Thanks.
How do I bring a .h or .cpp into the ide so I can read the code?
Thanks.
If you just want to read the code, use a text editor like Visual Studio Code.
If you want to include the library, you can just go to Sketch > Include Library in the IDE.
Thanks I figured it out. MS Word reads them. I've seen them in the ide before though. I just can't remember how to load one in.
Using Word with code is bound to end badly. If you're to the point of wanting to open library source files it's time for you to install a proper text editor. There are a lot of options and really it doesn't matter too much which one you choose. I use Notepad++. I don't trust Microsoft to do anything right but I have heard good things about Visual Studio Code.
You can add .h and .cpp files to your sketch in the Arduino IDE but doing that just to read a library file wouldn't make sense. I do use the Arduino IDE to write libraries but that's a different subject.
Opening code in MS Word is a bad idea. It is a word processor, not a plain text editor. Chances are that it will mess up the encoding or insert hidden characters that the compiler will choke on.
On top of that, it doesn't have syntax highlighting, linting, type checking, code folding, predictions, inline documentation, etc. that is provided by an IDE.
Do yourself a favor and install Visual Studio Code. It's free and open-source, and is supported on all platforms.
There is absolutely no good reason to use MS Word for code.
I find Notepad++ works well for almost any source file. You can download it for free here.
econjack:
I find Notepad++ works well for almost any source file. You can download it for free here.
Why would you download it from CNet if you can download it from the official website?
Because that's the first site that came up on my search.
Thanks to all of you!