• 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

Compilation error: conflicting declaration 'const int resolution'

Q&A Forum › Category: ESP32 › Compilation error: conflicting declaration 'const int resolution'
0 Vote Up Vote Down
Prakash asked 2 weeks ago

I copied a small piece of code 
i.e

// Setting PWM properties
const int freq = 30000;
const int pwmChannel = 0;
const int resolution = 8;
int dutyCycle = 200;

from  ESP32 with DC Motor – Control Speed and Direction | Random Nerd Tutorials into ESP32-CAM Remote Controlled Car Robot Web Server | Random Nerd Tutorials 
And I get the error
Compilation error: conflicting declaration ‘const int resolution’
 
Both the codes compiles separately without error!

Question Tags: ESP32CAM Robot PWM
2 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 2 weeks ago

Hi.
Check your code. You must have multiple variables with the same name declared multiple times. In this case, the variable resolution  seems to be declared more than once.
Regards,
Sara

0 Vote Up Vote Down
Prakash answered 2 weeks ago

Thank you.

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] ESP32-CAM Projects (version 1.3) January 7, 2023
  • [eBook Updated] SMART HOME with RPi, ESP32, and ESP8266 (version 1.1) November 20, 2022

You must be logged in to view this content.

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

Copyright © 2013-2023 · 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.