Page 1 of 1

38kHz carrier signal - Sparkfun ESP32 Thing

Posted: Sun Mar 25, 2018 10:03 pm
by fullstackfool
I used the following code to generate a 38kHz signal on a nano:

Code: Select all

// toggle on compare, clk/1
        TCCR2A = _BV(WGM21) | _BV(COM2A0);
        TCCR2B = _BV(CS20);

        // 38kHz carrier/timer
        OCR2A = (F_CPU / (IR_CLOCK_RATE * 2L) - 1);
        pinMode(pwmPin, OUTPUT);
        
Now I need to do the same on an esp32 and i'm not really sure where to start. I've tried a couple of resources like https://blog.hackster.io/build-an-am-ra ... 6b4b83cd80, but this is using the idf framework, while i'm trying to stick to Arduino.

Any help or pointers would be really appreciated

Re: 38kHz carrier signal - Sparkfun ESP32 Thing

Posted: Mon Mar 26, 2018 11:13 am
by WiFive