Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

CC3200 PWM and digitalread() behavior

$
0
0

I am trying to create a project that involves reading all of the digital pins while some pins may be in PWM mode. I do not want to read a pin if it is in PWM mode. According to the analogWrite documentation, a pulse will be sent out to a pin until another analogWrite has been called on that pin, or a digitalRead or Write. I first tried to find a way to check if a pin was in PWM mode, but couldn't find anything. I then called a digitalRead() on a pin after analogWrite() was called.  The pin continues in PWM mode after the digitalRead while the read returns a value.

 

  analogWrite(10,1); //sets LED to a dim light
  Serial.println(digitalRead(10)); //reads a value, sometimes 0, sometimes 1
  delay(3000); //light stays at same brightness as before

 

Is there a way to check if a digital pin is in PWM mode?

Why does a digitalRead on a pin in PWM mode not stop the PWM?

 

I'm using a CC3200 Launchpad and Energia binary from 9/5/2014.

 

Thanks


View the full article on Stellarisiti. 43oh pulls Stellarisiti Energia posts, so that members do not miss out questions. Please bear with this arrangement for now. Thanks!

Viewing all articles
Browse latest Browse all 2077

Trending Articles