The problem is once you use analogWrite on Adafruit nRF52 board, digitalWrites to that pin are ignored.
Arduino had a similar problem
digitalWrite and analogWrite do not work in combination · Issue #280 · arduino/ArduinoCore-arc32 · GitHub
and fixed it but Adafruit is so far refusing to fix their problem for over 1 year now.
The issue on Adafruit's github ends with the suggestion to ping if you want this fixed.
My view is that they should either fix the problem or clearly mark the board as not being compatible with the Arduino core functions. Ping them with your thoughts on this at
the Adafruit github issue
and with pinMode(pin, OUTPUT) before digitalWrite?
Yes tried that first. Did not work and even if it did it is still not way Arduino works
Arduino requires pinMode before using digitalWrite. undocumented behavior on some board can't be expected on other
The Arduino programming language Reference, organized into Functions, Variable and Constant, and Structure keywords.
reference of analogWrite, it is described as if it can be overwritten by digitalWrite and digitalRead.
After a call to
analogWrite() , the pin will generate a steady rectangular wave of the specified duty cycle until the next call to
analogWrite() (or a call to
digitalWrite() ) on the same pin.
Of course, this is possible with Uno, Nano and some boards, but other cores may not be able to do this.
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.