Using pulseIn with analogWrite


it seems analogwrite not work when being used pulsein.

here simple code:
code: [select]
void loop()
{
 int pulse = pulsein(3,100);
 pulse -= 1020;
 if(pulse < 0)
   pulse = 0;
   pulse = 420 - pulse;
   pulse *= 0.607;
   serial.println(pulse);
   analogwrite(13,pulse);
}


the value of pulse verified 0-255 printing out value, led on pin 13 doesnt dimmer/brighter, turns on or off @ mid range. ideas?

"this function works on pins 3, 5, 6, 9, 10, , 11."

from analogwrite reference: http://www.arduino.cc/en/reference/analogwrite


Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > Using pulseIn with analogWrite


arduino

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums