Skip to content

analogSetPinAttenuation does not work with Board v1.0.5 and v1.0.6, but it works with board 1.0.4. How can i fix this problem? #5041

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

Closed
cbkaefer opened this issue Apr 11, 2021 · 3 comments · Fixed by #5399
Assignees
Milestone

Comments

@cbkaefer
Copy link

cbkaefer commented Apr 11, 2021

Hardware:

Board ESP32 Dev Module
Version/Date 1.0.6
IDE name Arduino IDE
Flash Frequency 80Mhz
PSRAM enabled no
Upload Speed 115200
Computer OS Windows 10

Description:

analogSetPinAttenuation does not work with Board v1.0.5 and v1.0.6, but it works with board 1.0.4.
There is no fault message, the compiler works with this code, but it takes no effect.
How can i fix this problem?

Sketch: (leave the backquotes for code formatting)

//Change the code below by your sketch
#include <Arduino.h>

void setup() {
analogSetPinAttenuation(34, ADC_0db);
adcAttachPin(34);
}

void loop() {
Serial.println(analogRead(34);
}
@Triangulix
Copy link

Looks like they completely broke the ADC API. Non-blocking reading is also gone.

@ssieb
Copy link

ssieb commented Jun 25, 2021

There's a bug in #3377. It wipes out the attenuation setting every time you do a read.

@jesserockz
Copy link

Specifically a bug with

__analogSetPinAttenuation(pin, __analogAttenuation);

being called every time the adc pin is attached to, which overrides the analogSetPinAttenuation called from the code above

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

Successfully merging a pull request may close this issue.

6 participants