Skip to content

analogWrite() on low numbered digital pins not working #1

Closed
@madman2003

Description

@madman2003

I have a Nucleo64 L476RG, and i noticed i cannot do PWM using the analogWrite() function when using D2, while i can with D8. D2 being wired to PA10 should have this capability.

I found this in variant.h which looks suspicious:
// Convert an analog pin number Axx to a PinName Pxy
#define analogToPinName(p) ((p < NUM_ANALOG_INPUTS) ? digitalToPinName(p+A0) : digitalToPinName(p))

This function is then used by analogWrite()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Something isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions