Can't get PWM output with myMega 2560


hi guys

i trying measurement with  brand new multimeter able read pwm , frequencies , wanted pwm signal on 1 of pin of mega 2560

so write simple code :
code: [select]
void loop(){
analogwrite (8, 127);
}


but impossible signal.
i change pin 1 1 still nothing !

using voltmeter, tried different value pwm analogwrite(pin, pwmvalue) , 0v 0 254 , 5v 255 !

then tried #13 pin has embeded led , there got strange behavior :
analogwrite(13, 255), light led continuously 5v on pin.
analogwrite(13, 0 254) blink led @ low frequency 1 or 2hz morse signal .._.._.._ . led on , _ led off. shape of blinking seems same pwm value in range 0-254.

would have explanation , solution prolem ?

do need do
pinmode (8, output);
with that?


Arduino Forum > Using Arduino > Installation & Troubleshooting > Can't get PWM output with myMega 2560


arduino

Comments

Popular posts from this blog

DHT11 Time out error using v0.4.1library

Sketch upload fails with Java error (___REMOVE___/bin/avrdude)!

Arduino Uno + KTY81/210 temperature sensor