Forum Rule: Always post complete source code & details to reproduce any issue!

Search:

Type: Posts; User: PaulStoffregen

Search: Search took 0.03 seconds.

  1. You can NOT get a square wave output with this: ...

    You can NOT get a square wave output with this:



    analogWriteResolution(1);//make it single-bit only (need a SQW)


    One bit of resolution means the only 2 possible outputs are always HIGH...
  2. If you can reproduce the problem, please post the...

    If you can reproduce the problem, please post the code and I'll take a look at it next week.
  3. I don't understand. As a quick sanity check, I...

    I don't understand. As a quick sanity check, I tried this. A 25 kHz waveform is on pin 6.



    void setup() {
    analogWriteFrequency(6, 25000);
    analogWrite(6, 120);
    }
    void loop() {
    }
  4. Yes. Actually, analogWriteFrequency() only...

    Yes. Actually, analogWriteFrequency() only configures which frequency will be produced. You then use analogWrite() to actually write to the pin.



    The PWM is generated by hardware, so there's...
Results 1 to 4 of 4