38kHz carrier signal - Sparkfun ESP32 Thing

fullstackfool
Posts: 2
Joined: Mon Mar 19, 2018 6:51 am

38kHz carrier signal - Sparkfun ESP32 Thing

Postby fullstackfool » Sun Mar 25, 2018 10:03 pm

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

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: 38kHz carrier signal - Sparkfun ESP32 Thing

Postby WiFive » Mon Mar 26, 2018 11:13 am


Who is online

Users browsing this forum: forrest and 110 guests