Interrupt Feather V2

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
forum_questions_1
 
Posts: 114
Joined: Tue Oct 25, 2022 4:05 pm

Interrupt Feather V2

Post by forum_questions_1 »

Hi, I would like to create a timer interrupt to regulate how often the WiiChuck library updates readings from a joystick. I have a millis routine in the loop to do it (if elapsed millis = 100, update map) but I wanted to see if I could do the same thing outside the loop.

I am using a Feather V2 and Arduino IDE. I looked at https://learn.adafruit.com/multi-taskin ... t-2/timers and tried to use OCR0A=0xAF; and TIMSK0 |= _BV(OCIE0A); but I am wondering if those are specific to the Uno.

Thank you.

User avatar
adafruit_support_carter
 
Posts: 29483
Joined: Tue Nov 29, 2016 2:45 pm

Re: Interrupt Feather V2

Post by adafruit_support_carter »

That code is indeed specific to the UNO. It's actually specific to the ATmega328 (maybe other AVRs) chip on the UNO. So it could potentially work for other ATmega328 based boards. But in general, it is very low level processor specific code.

User avatar
forum_questions_1
 
Posts: 114
Joined: Tue Oct 25, 2022 4:05 pm

Re: Interrupt Feather V2

Post by forum_questions_1 »

Ok, thank you. Do you know of any examples for the ESP32? I found a couple of videos with examples and got one to work, but just wondering if there is anything on Adafruit github or in the learning section. Thanks!

User avatar
adafruit_support_carter
 
Posts: 29483
Joined: Tue Nov 29, 2016 2:45 pm

Re: Interrupt Feather V2

Post by adafruit_support_carter »

Sorry, not aware of any easy references for the equivalent thing for ESP32.

User avatar
forum_questions_1
 
Posts: 114
Joined: Tue Oct 25, 2022 4:05 pm

Re: Interrupt Feather V2

Post by forum_questions_1 »

No problem. Thank you.

Locked
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”