Documentation error on Pulsed Output: PWM & Tone

Ira

Member
I'm using a OSH Teensy 3.1, Arduino 1.0.6 and Teensyduino 1.2

This page:

http://pjrc.com/teensy/td_pulse.html

Contains the sentence:

Code:
The value is between 0 to 255, where the higher the value, the more time the signal remains high. The value is referred to in percentage terms as "duty cycle". A value of 128 is 50% duty cycle.

But I seem to need to send 256 to make it 100% and when I change the resolution, analogWriteResolution(7), I need to send 128 to get 100%.

Am I doing something wrong or it the documentation wrong?

Also, once I've said analogWrite(), should digitalWrite() override it and put it back to a digital pin or is there something else I need to do?

Thanks, Ira
 
Back
Top