Can't get libraries working

Hi All,

I’m new to PlatformIO and I can’t figure out how to get libraries working. I’m working on an Arduino uno. I should mention I have a lot of industrial PLC programming/automation experience, but very little C programming or the like.

Inside PlatformIO I’ve installed the ‘max6675’ library to my project. I’ve also verified my platformio.ini has the following line:
lib_deps = MAX6675

Whenever I type #include <max6675.h> I get an error.

I feel like I’m missing something basic because I’ve had this same issue on two separate computers.

Try:

lib_deps =
     siruli/MAX6675

The indent is one tab character, or 4 spaces when split over two lines.

There are quite a few Max6675 libraries, this link will show you them all, and each has a separate pages showing installation, examples and a list of their header files.

You are interested in those specified as being for Arduino, obviously.

HTH

Cheers,
Norm.

Hey Norman,

Thanks for the response. I added the MAX6675 library to my project via PIO Home. I’m still not having any luck. I took a screenshot of my code and my .ini file if that helps?

Ctrl+Shift+P → Rebuild Intellisense, or just press “Build” once. The library won’t be included in the IntelliSense until the intellisense is updated through a build (or manual intellisense rebuild).

Thanks for the reply. The options I saw were “PlatformIO: Build” and “PlatformIO: Rebuild IntelliSense Index”. I did both but it’s still not working.

What does “Build” result in?

Here’s the Build result

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/uno.html
PLATFORM: Atmel AVR (3.3.0) > Arduino Uno
HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 31.50KB Flash
DEBUG: Current (avr-stub) On-board (avr-stub, simavr)
PACKAGES:
 - framework-arduino-avr 5.1.0
 - toolchain-atmelavr 1.70300.191015 (7.3.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 6 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <Ethernet> 2.0.0
|   |-- <SPI> 1.0
|-- <SPI> 1.0
Building in release mode
Checking size .pio\build\uno\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   4.6% (used 94 bytes from 2048 bytes)
Flash: [=         ]  10.9% (used 3530 bytes from 32256 bytes)
================================================================================================== [SUCCESS] Took 0.89 seconds ==================================================================================================

Terminal will be reused by tasks, press any key to close it.

The usede libraries are Ethernet but not the Max6675 lib? Are you sure you’ve selected the correct environment via the project environment switcher in the taskbar at all?

I haven’t done anything inside the Project window. Here’s what mine looks like currently.

Click on the “env:…” in the bottom blue taskbar in VSCode and select uno in the MAX6675 project, then rebuild.

1 Like

Edit: I found the environment and changed it, and it worked. Thanks so much!

1 Like