1

I'm playing around with the Pico SDK and the extension in VS Code and it seems that when I produce a C++ file program instead of C, a number of the hardware options are no longer available to include. Specifically in my case I would like to use the ADC

#include "hardware/adc.h"

This worked fine with a C program but is not longer available in C++.

 fatal error: hardware/adc.h: No such file or directory

Why is this the case and is there anything I can do about it? I would prefer to use C++ for my programs as I want to use some of the standard libraries included with C++ and for me it is more intuitive.

4
  • Make sure you pass the correct include path to your C++ compiler. Commented Apr 29 at 11:11
  • which "the extension in VS Code" are you talking about and how did you configure it? Commented Apr 29 at 11:13
  • @Botje - the official Raspberry Pi Pico extension (marketplace.visualstudio.com/items/…) Commented Apr 29 at 11:16
  • @JesperJuhl - I think they are correct as some of the hardware libraries can still be included (e.g. hardware/gpio.h or uart.h) but some can't (like adc.h or flash.h) Commented Apr 29 at 11:18

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.