-
I have some issues with the analog read function of my STM32L082KZ. I have made a custom variants, peripherals file etc. to integrate the board into the PlatformIO environment. In the past (1/2 years ago) it worked perfectly fine but now when i try to use the analogread function it always returns 0. I know for certain it worked with the PA6 pin, but PA 4 and 5 are new pins i want to connect. I have written a small code to test the functionality:
This code shows that when using digitalRead the pin does register a voltage but analogread still returns 0. My variants.cpp file is built as follows:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Your variant .cpp is not correct. |
Beta Was this translation helpful? Give feedback.
-
So your variant is not correctly defined. Analog pin should be declared using PIN_AX. Check how other variant are defined and also the wiki |
Beta Was this translation helpful? Give feedback.
So your variant is not correctly defined. Analog pin should be declared using PIN_AX. Check how other variant are defined and also the wiki