2 Process at once

I think I’m about to take my next step in programming with this project! (insert scary music here)

On pin 3 send a 38khz tone that ‘blinks’ on and off. ← EASY TO DO!
Get a tsopxx38 to detect the 38KHZ ‘blink’ ← EASY TO DO!
When I do it on the 1 Arduino I get 2 loops waiting on each other. Of course this doesnt work so… I need 2 Arduinos to do it!

Is there a way I can set a ‘blink’ on a pin with an interrupt or something… I’m not sure how to go about this. If you would like to see example code, but I think people who understand, understand.

Big thanks!

:slight_smile:

Yes you can do this by arranging the timer to generate an interrupt at 38kHz.
Then in the interrupt service routine turn your IR LED on and off as appropriate to generate your message,

Can you point me to a tutorial?

I'm afraid I don't know... What I don't know. IE I need a starting place.

Is this a real project or is it just something you're fiddling with? I can't see the point of an Arduino talking to itself via IR, since if you can program the blink, well you know what it is already, and so it seems odd to calculate the blink, send it out and read it back in....

But I can see it being a useful exercise for its own sake.

Actually,

What you have said is enough. I have direction.

Big Thanks!

Really I'm playing for the sake of playing. I'm from the pic world and these Arduino's are SOOO ease for quick development!
I LOVE them.

Low Cost, Hi Impact microprocessor! Great devices. I'm starting to wonder how much further I can push them.

:slight_smile:

Swmitchell:
Can you point me to a tutorial?

I'm afraid I don't know... What I don't know. IE I need a starting place.

Just look up anything on sending IR remote control messages with the arduino.

This link may be of interest.

...R

That's a great tutorial!

And was going to be my next adventure!

:slight_smile:

38KHz is 1 on/off every 421 Arduino cycles with some of those used to turn the led on/off.
Just be mindful not to waste cycles or block with whatever else you do.