Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ledcAttach is undefined #9169

Closed
1 task done
patrickwasp opened this issue Jan 23, 2024 · 6 comments
Closed
1 task done

ledcAttach is undefined #9169

patrickwasp opened this issue Jan 23, 2024 · 6 comments
Labels
3.0 migration issue relates to migration from 2.X to 3.X version

Comments

@patrickwasp
Copy link

Board

ESP32S3

Device Description

Seeed Studio XIAO ESP32S3, attached to nothing

PLATFORM: Espressif 32 (2023.11.1) > Seeed Studio XIAO ESP32S3

Hardware Configuration

nothing connected

Version

other

IDE Name

PlatformIO

Operating System

Ubuntu

Flash frequency

40

PSRAM enabled

yes

Upload speed

115200

Description

'ledcAttachChannel' was not declared in this scope

https://espressif-docs.readthedocs-hosted.com/projects/arduino-esp32/en/latest/api/ledc.html

Sketch

void setup() {
  ledcAttach(LED_BUILTIN, 2000, 12);
}

void loop(){}

Debug Message

/tmp/arduino_modified_sketch_36424/ledcFrequency.ino: In function 'void setup()':
ledcFrequency:2:3: error: 'ledcAttach' was not declared in this scope
   ledcAttach(LED_BUILTIN, 2000, 12);
   ^~~~~~~~~~
/tmp/arduino_modified_sketch_36424/ledcFrequency.ino:2:3: note: suggested alternative: 'ledcAttachPin'
   ledcAttach(LED_BUILTIN, 2000, 12);
   ^~~~~~~~~~
   ledcAttachPin
exit status 1
'ledcAttach' was not declared in this scope

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@patrickwasp patrickwasp added the Status: Awaiting triage Issue is waiting for triage label Jan 23, 2024
@lbernstone
Copy link
Contributor

The API has changed. ledcAttachPin was v2.x. ledcAttach is v3.0
The compiler is telling you the exactly correct answer.

@P-R-O-C-H-Y P-R-O-C-H-Y added 3.0 migration issue relates to migration from 2.X to 3.X version and removed Status: Awaiting triage Issue is waiting for triage labels Jan 24, 2024
@P-R-O-C-H-Y
Copy link
Member

For more details please take a look on MIGRATION GUIDE FROM 2.X TO 3.X.

@ecoreng
Copy link

ecoreng commented Mar 21, 2024

OP is saying ledcAttach and ledcAttachChannel "was not declared in this scope" which they should in 3+.

This is puzzling me too. I can't get platformio to make them available, even after clearing the platformio "cached" espressif-arduino stuff.

@ecoreng
Copy link

ecoreng commented Mar 21, 2024

ok, If I had to guess it's because it's not stable:
https://github.com/espressif/arduino-esp32/releases

and thus, platformio hasn't released their platform with it:
https://github.com/platformio/platform-espressif32/releases

This is platformio's problem though, not espressif's

@nsmith1024
Copy link

Hello, was this fixed? it is still not defined.

@me-no-dev
Copy link
Member

@nsmith1024 API has changed, this will never be "fixed" you need to use the new API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.0 migration issue relates to migration from 2.X to 3.X version
Projects
None yet
Development

No branches or pull requests

6 participants