Timers, PWM and analogWrite
can explain why, in attached sketch, works intended (hi, medium, hi, medium...) when "redled" (pin11) in lines 41 , 46 written to?
if change statements in lines 41 , 46 either "greenled" (pin 9) or "blueled" (pin 10), analogwrite statement acts digitalwrite. i.e. pwm less 255 manifests off.
all 3 of these pins labeled pwm pins. timers conflicting pwm? way around this?
thanks help. -scott
if change statements in lines 41 , 46 either "greenled" (pin 9) or "blueled" (pin 10), analogwrite statement acts digitalwrite. i.e. pwm less 255 manifests off.
all 3 of these pins labeled pwm pins. timers conflicting pwm? way around this?
thanks help. -scott
pin 11 pwm controlled timer 2. pwm pins 9 , 10 controlled timer 1. timer 0 affects millis(), micro(), , delay(...).
i guess use of timers 0 , 1 not compatible use of pins 9 , 10 don't understand finer details.
there libraries may out, or choose other pins.
i guess use of timers 0 , 1 not compatible use of pins 9 , 10 don't understand finer details.
there libraries may out, or choose other pins.
Arduino Forum > Using Arduino > Programming Questions > Timers, PWM and analogWrite
arduino
Comments
Post a Comment