Using pulseIn with analogWrite
it seems analogwrite not work when being used pulsein.
here simple code:
the value of pulse verified 0-255 printing out value, led on pin 13 doesnt dimmer/brighter, turns on or off @ mid range. ideas?
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
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
Post a Comment