-
Notifications
You must be signed in to change notification settings - Fork 1k
Not all STM32 Pin names (e.g. PC6,PC8...) are working #54
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
Comments
Could you indicate us which pin (STM32 name) doesn't work when you use the Arduino name? |
PC6,PC8,PC9 are not working... the others i have to check one more time. |
Hi @Adminius, This is normal, using PC6 is equivalent to call with 38 (0x26). You could use pinNametoDigitalPin() function to convert PYx to Dx (but it seems not well exported :'( I have to fix that) One other solution could be to provide API with PinName as argument analogWrite2(PinName) |
Ahh, ok... pinNametoDigitalPin is ok for me. |
I have correcting the issue with the pinNametoDigitalPin export. So your sketch could use it like that (Serial could be removed):
|
Fix stm32duino#54 Signed-off-by: Frederic.Pillon <[email protected]>
i tried to test PWM on 19 pins. with this code:
`int pins[] = {PC6,PC8,PC9,PB8,PB9,PA5,PA6,PA7,PB6,PC7,PA9,PA8,PB10,PB3,PA10,PB11,PB1,PB7,PB0};
//int pins[] = {34, 33, 32, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 3, 2, 39, 41, 22, 49 };
void setup() {
}
void loop() {
for(int i = 0; i<19;i++){
for (int fadeValue = 0 ; fadeValue <= 255; fadeValue += 5) {
analogWrite(pins[i], fadeValue);
delay(30);
}
}
for(int i = 0; i<19;i++){
for (int fadeValue = 255 ; fadeValue >= 0; fadeValue -= 5) {
analogWrite(pins[i], fadeValue);
delay(30);
}
}
}`
if i use STM32 style names, not all LEDs are working.
With Arduino names all LEDs are working.
For NUCLEO Morpho connectors it's easier to use STM32 style.
Tested on L476 with 2017.6.2 core.
The text was updated successfully, but these errors were encountered: