Due is unable to DigitalWrite to a pin once Analog Write has occurred. Attached is a simple sketch. Please let me know if I am missing something. On Digital write it outputs 3.299 volts for 10 seconds then outputs pwm of 1.608 continuously. it will not produce a digital output once analog write occurs. I have tried this on 2 Dues. Works fine on Uno and Mega 2560.
void setup()
{
pinMode(4,OUTPUT);
}
void loop() {
digitalWrite(4, HIGH); // digital
delay (10000);
I don't understand why you would want to do this. Just asking for some education.
I would say that's just a test program konasilly has provided to show the problem.
As written thought it will provide a 10-second burst of PWM pulses every 30 seconds, that may make sense to an application somewhere, the world is a complicated place
Let's say you wanted to flash a LED with that sequence and also control the brightness.