Page MenuHomePhabricator

Keyestudio Smart Home ESP32-KS5009 3.Arduino tutorials>>arduino Code>>pj1_2_breath_led multiple definition error when compiling
Closed, InvalidPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

In the KIT KS5009 from Keyestudio, when compiling the pj1_2_breath_led.ino I receive the following compilation error:

What happens?:

c:/users/xxx/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch5/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\xxx\AppData\Local\Temp\arduino-core-cache\core_16b61f3b06e01ca2cfac27b10db859eb.a(esp32-hal-ledc.c.o): in function `analogWriteResolution':
C:\Users\xxx\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.6\cores\esp32/esp32-hal-ledc.c:252: multiple definition of `analogWriteResolution'; C:\Users\xxx\AppData\Local\Temp\arduino-sketch-8DCC29490EA27F8CC745AE999190E5C0\libraries\ESP32_AnalogWrite\analogWrite.cpp.o:c:\Users\xxx\OneDrive\Documents\Arduino\libraries\ESP32_AnalogWrite/analogWrite.cpp:74: first defined here
collect2.exe: error: ld returned 1 exit status

exit status 1

Compilation error: exit status 1

What should have happened instead?:

Should compile with no errors and upload the sketch to the board

Software version (skip for WMF-hosted wikis like Wikipedia):
Arduino IDE: 2.0.3

Other information (browser name/version, screenshots, etc.):
If we remove line #1:

#include <analogWrite.h>  //Import PWM output library files

The compilation finishes and uploads the sketch and the expected LED breathing effect occurs, so I guess the issue can be solved by removing this line(at least in my case)

Event Timeline

Vahurzpu subscribed.

This ticket doesn't pertain to any Wikimedia-associated software, so this isn't the right place for your question. If you want Arduino help, try asking your question on https://arduino.stackexchange.com or https://forum.arduino.cc