• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Vs Code x PWM

Q&A Forum › Category: ESP32 › Vs Code x PWM
0 Vote Up Vote Down
Jose Ramos Silva asked 5 years ago

Hi Rui,
Is there any library to add to VS Code IDE to compile ESP32 with PWM? I tried to compile the code provide by  https://raw.githubusercontent.com/RuiSantosdotme/ESP32-Course/master/code/LED_PWM_Example_2/LED_PWM_Example_2.ino,
but there isn’t definition to ledcSetup, ledcWrite and ledcAttachPIn functions. This code run perfectly when we use the Arduino IDE.
 

Question Tags: Vs Code
3 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Hi Jose.

When using VS Code to program your boards, you always need to include this line at the beginning of your code:

#include <Arduino.h>

Tell me if this solves your issue.

Regards,
Sara

0 Vote Up Vote Down
Jose Ramos Silva answered 5 years ago

Thank you very much, Sara.
You fixed it. As I suspected, it was one more beginner’s mistake.
Regards,
Jose

0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

You’re welcome 🙂
I’ll mark this question as resolved.
If you need further help, you just need to open a new question in our forum.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.