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

Error 'adc_gpio_init' was not declared in this scope #3

Open
flasher69 opened this issue Aug 25, 2022 · 21 comments
Open

Error 'adc_gpio_init' was not declared in this scope #3

flasher69 opened this issue Aug 25, 2022 · 21 comments

Comments

@flasher69
Copy link

flasher69 commented Aug 25, 2022

Hi guys,

when I try to compile the code in Arduino IDE and VS/PlatformIo I get this error message:

'adc_gpio_init' was not declared in this scope

I don't really understand what is missing there. Any ideas?

Thank you

In file included from C:\Users\amira\OneDrive\Documents\libraries\FFT_EPS32_V1.0\FFT_EPS32_V1.0.ino:56:
C:\Users\amira\OneDrive\Documents\libraries\FFT_EPS32_V1.0\I2SPLUGIN.h: In function 'void setupI2S()':
I2SPLUGIN.h:52:8: error: 'adc_gpio_init' was not declared in this scope
  err = adc_gpio_init(ADC_UNIT_1, ADC_CHANNEL_0); //step 1
        ^~~~~~~~~~~~~
C:\Users\amira\OneDrive\Documents\libraries\FFT_EPS32_V1.0\I2SPLUGIN.h:52:8: note: suggested alternative: 'gpio_init'
  err = adc_gpio_init(ADC_UNIT_1, ADC_CHANNEL_0); //step 1
        ^~~~~~~~~~~~~
        gpio_init
exit status 1
'adc_gpio_init' was not declared in this scope


@donnersm
Copy link
Owner

looks like you renamed some files. Try downloading the zip file from github again, unpack it to a blank folder and run the sketch unmodified from there.
Also make sure you are using the same libary versions as i did. version numbers are in the manual

@flasher69
Copy link
Author

when I try to open FFT_EPS32_V1.0.ino in Arduino IDE I get an error that the folder needs to have the same name as the ino file itself (currently it is in C:\Users\me\OneDrive\Documents\libraries\FFT_ESP32_Analyzer-main\Main Sketch\V1.0) and I cannot open it unless I create a folder with the same name as the ino file (that's why I had to rename the V1.0)
I've checked the libraries and they are all the same versions as you've suggested it in your manuall.

@donnersm
Copy link
Owner

donnersm commented Aug 25, 2022

rduino IDE I get an error that the folder needs to have the same name as/......allow it to b renamed but after, move the other files from the zip like I2SPLUGIN.h to same folder.

Try downloading the zip package again...I renamed the main .ino file....now unpacking to blank folder and running sketch will work
please try it

Also there is a precompiled version you can try..but it is for use with pixelleds...32 channels each channel 16 leds
https://donnersm.github.io/Webflash-FFT/flash.html

@flasher69
Copy link
Author

I tried what you've suggested but unfortunately same results. and same code error.
The webinstaller did work though. I will try it with WS2812 next days since I don't have anymore of them laying around.
Thank you Mark for your help

@flasher69
Copy link
Author

Hi Mark,
I've tired a bit and this issue seems be caused by Arduino IDE iteself (or maybe my PC?!). Anyway I've installed another older version of Arduino IDE (1.18.13) on a different PC and suddenly I don't get this error anymore!
Anyway thank you for your help :)

@jeurgenK
Copy link

jeurgenK commented Aug 30, 2022

Hi,
I'm German. My English is not so good. Sorry.

The Problem is the espressif Version 5.1.1. With the espressif Version 3.5.0 is no Problem in VSCode.
Why, i don't know.

Mfg
Jürgen

@flasher69
Copy link
Author

Hi, I'm German. My English is not so good. Sorry.

The Problem is the espressif Version 5.1.1. With the espressif Version 3.5.0 is no Problem in VSCode. Why, i don't know.

Mfg Jürgen

Danke Jürgen. Das ist gute Hinweis :)

Thanx a lot

@jeurgenK
Copy link

jeurgenK commented Sep 2, 2022

Hi,
that's how it would work. The version number is specified in the platformio.ini.

[env:esp32dev]
platform = espressif32@^3.5.0

With best regards from Cologne
Juergen

@flasher69
Copy link
Author

Hi, that's how it would work. The version number is specified in the platformio.ini.

[env:esp32dev] platform = espressif32@^3.5.0

With best regards from Cologne Juergen

Thank you Juergen. That really solved the issue but I also had to change the Adafruit GFX Library version 1.11.3. After that I had no issues with the compiling.

Thanx again for all your helps guys.

cheers

@Aggebitter
Copy link

Hi, I'm German. My English is not so good. Sorry.

The Problem is the espressif Version 5.1.1. With the espressif Version 3.5.0 is no Problem in VSCode. Why, i don't know.

Mfg Jürgen

https://www.esp32.com/viewtopic.php?t=25244

@houstontang
Copy link

hi Sir, I met error: I2SPLUGIN.h:53:8: error 'adc_gpio_init' was not declared in this scope;
also I found you have included two library "driver/i2s.h" and "driver/adc.h", but I can't find these two .h files in the package. can you please help to check? thanks!

@jeurgenK
Copy link

Hi houstontang,
adc_gpio_init is no longer needed and can be deleted.
I use the espressif PLATFORM:
Espressif 32 (6.4.0) > Espressif ESP32 Dev Modules.
I hope I could help you.

@houstontang
Copy link

hi JeurgenK:
thanks for your reply! I'm using an ESP32 Dev module as well, the SDK I have is ESP32 2.03, but I couldn't finish compiling on my side using Arduino IDE, can you please share me a workable package? my personal email: [email protected],
by the way, do you need "driver/i2s.h" and "driver/adc.h" file which are included in "I2SPLUGIN.h" file. thanks!

Houston

@houstontang
Copy link

Jeurgenk, now I got you that you're using vscode+platfromIO, and using espressif32 6.4.0, while I'm using Arduino IDE, in the github package, the main sketch file v1.0.ino is still arduino format, did you just change it to .cpp and then use platfromIO? can you share me the PIO package via [email protected]? thanks a lot!

@tanghq8181
Copy link

when I tried to compile the package, it will display"include/I2SPLUGIN.h:53:8: error: 'adc_gpio_init' was not declared in this scope" no matter I use Arduino IDE or PlatfromIO, if I disable below code, the compiling can be done, but I'm not sure if function is ok:
/*
err = adc_gpio_init(ADC_UNIT_1, ADC_CHANNEL_0); //step 1
if (err != ESP_OK) {
Serial.printf("Failed setting up adc channel: %d\n", err);
while (true);
}

err = adc_gpio_init(ADC_UNIT_1, ADC_CHANNEL_3); //step 1
if (err != ESP_OK) {
Serial.printf("Failed setting up adc channel: %d\n", err);
while (true);
}
*/

@jeurgenK
Copy link

OK,
i have Arduino IDE 2.2.1

my include 👍
#include <driver/i2s.h>
#include <driver/adc.h>

Message from Arduino IDE 👎
Using board 'esp32' from platform in folder: C:\Users\admin\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14
Using core 'esp32' from platform in folder: C:\Users\admin\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14

you need the libs:
WebServer.h in Version 2.0.0
WebSockets in Version 2.3.7
please, look at github.

Please check this.

by from Cologne

@houstontang
Copy link

one more maybe last question for this issue, if you mark/disable below adc_gpio_init code, is the function normal? if you didn't mark/disable below adc_gpio_init code, do you get similar error message ( error: 'adc_gpio_init' was not declare)? thanks!

/*
err = adc_gpio_init(ADC_UNIT_1, ADC_CHANNEL_0); //step 1
if (err != ESP_OK) {
Serial.printf("Failed setting up adc channel: %d\n", err);
while (true);
}

err = adc_gpio_init(ADC_UNIT_1, ADC_CHANNEL_3); //step 1
if (err != ESP_OK) {
Serial.printf("Failed setting up adc channel: %d\n", err);
while (true);
}

@jeurgenK
Copy link

Hallo houstontang,
I can't say much about the Arduinio program because I use Visual Studio Code. I would definitely switch to Visual Studio Code. Simplifies programming and costs nothing.
I have no problem compiling with VS Code. Check Google for installation. There are enough videos there.

Have a nice day
J. Kommos

@bungalit
Copy link

If you get a compilation error saying "adc_gpio_init" is not declared, it is because the function is now deprecated.
Fix the error by adding:
#include <driver/adc_deprecated.h>
to the file I2SPLUGIN.h

Thank you very much to the author for this project!
Good luck to all!

@jeurgenK
Copy link

jeurgenK commented May 21, 2024 via email

@jeurgenK
Copy link

jeurgenK commented May 21, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants