Hi,
I'm using a NUCLE-G431RB with the arduino framework and PlatformIO.
I'm trying to do an analogRead() on pin PC2 and PC3, but it doesn't work. The problem seems to be that the function analogInputToDigitalPin() return NC for those pin.
Is there someting that I missed ?
Thanks !
Unable to use analogRead() with pin PC3 and PC2
-
- Posts: 3
- Joined: Mon Nov 21, 2022 3:16 pm
Unable to use analogRead() with pin PC3 and PC2
I've added the missing analog pins.
Pay attention some of them are by default other functions (LED, VCP,...)
https://github.com/stm32duino/Arduino_C ... a43f72f0ff
Go to full postPay attention some of them are by default other functions (LED, VCP,...)
https://github.com/stm32duino/Arduino_C ... a43f72f0ff
Re: Unable to use analogRead() with pin PC3 and PC2
Looking at the variant:
https://github.com/stm32duino/Arduino_C ... 31RB.h#L48
PC2 and PC3 are not defined as analog pins.
Don't know why as they have analog capabilities:
https://github.com/stm32duino/Arduino_C ... Pins.c#L59
https://github.com/stm32duino/Arduino_C ... 31RB.h#L48
PC2 and PC3 are not defined as analog pins.
Don't know why as they have analog capabilities:
https://github.com/stm32duino/Arduino_C ... Pins.c#L59
Re: Unable to use analogRead() with pin PC3 and PC2
I've added the missing analog pins.
Pay attention some of them are by default other functions (LED, VCP,...)
https://github.com/stm32duino/Arduino_C ... a43f72f0ff
Pay attention some of them are by default other functions (LED, VCP,...)
https://github.com/stm32duino/Arduino_C ... a43f72f0ff
-
- Posts: 3
- Joined: Mon Nov 21, 2022 3:16 pm
Re: Unable to use analogRead() with pin PC3 and PC2
Hi @fpiSTM,
Thanks for your help !
I would like to test your change, but I don't konw how to set platformio to use the commit you make. Can you help me with that ?
Thanks !
Thanks for your help !
I would like to test your change, but I don't konw how to set platformio to use the commit you make. Can you help me with that ?
Thanks !
Re: Unable to use analogRead() with pin PC3 and PC2
Unfortunately not. I do not use pio.
-
- Posts: 3
- Joined: Mon Nov 21, 2022 3:16 pm
Re: Unable to use analogRead() with pin PC3 and PC2
Ok, adding this line forced platformio to clone the lattest commit :
Everything seems to be working fine now !
Thanks !
Code: Select all
platform_packages = platformio/framework-arduinoststm32 @ https://github.com/stm32duino/Arduino_Core_STM32.git#main
Thanks !