analogWrite, how to stop the pwm?

DrM

Well-known member
Hi,

After setting up PWM output ona digital I/O pin, is there a way to turn it off and restore the pin to being a simple digital I/O pin?
 
Yes, there is.
Code:
void setup() {
}

void loop() {
  analogWrite(5, 64);
  delay(1000);
  pinMode(5, OUTPUT);
  digitalWrite(5, LOW);
  delay(500);
}

Paul
 
Back
Top