Pages: [1]   Go Down
Author Topic: arduino mega 2560 ir library  (Read 1596 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Edison Member
*
Karma: 5
Posts: 1730
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Im planning on a project utilizing the ir library but I was researching and it seems the mega2560 isn't directly compatible due to something with the timer 2 and different hardcoded pins
does a modded library exist that I can simply download, or do I need to modify the library file? Im good at arduino code sorta, so I probablly could but I don't know anything about the actual hardware or what to change
Logged

0
Offline Offline
Shannon Member
****
Karma: 200
Posts: 11694
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The Arduino pins corresponding to the various timers for Arduino and Mega are summarised in a table on my page about ATmega timers: http://www.mythic-beasts.com/~markt/ATmega-timers.html
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Edison Member
*
Karma: 5
Posts: 1730
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So if I substitute the uno pin for mega it will wori without code change because it is based on the timer mapping, correct?
Logged

Lake Tyers Beach
Offline Offline
Full Member
***
Karma: 2
Posts: 126
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Did you get anywhere with the Arduino Mega IR functions problem.
I have tried to get my Mega 2560 to do a simple read of a 38kHz IR detector and having tried a few pins, 11,10 and 47 have got unreliable results and most of it not decoding at all.
Some of the dumps sort of look promising -
Quote
0
Could not decode message
Raw (68): -13296 8850 -4450 500 -650 450 -600 550 -600 450 -650 500 -600 500 -600 500 -600 500 -600 500 -1750 500 -1700 500 -1700 500 -1750 500 -1700 500 -1700 500 -1750 500 -1700 500 -1700 500 -650 450 -1750 450 -650 500 -1700 500 -650 450 -650 450 -650 500 -600 500 -1700 500 -650 450 -1750 500 -600 500 -1700 500 -1700 550 -1700 500
0
Could not decode message
Raw (26): 16764 2400 -600 550 -650 550 -650 1200 -600 550 -650 550 -650 550 -650 550 -700 1150 -650 550 -650 550 -650 550 -650 550
210
Decoded SONY: 210 (12 bits)
Raw (26): -25000 2350 -600 550 -650 550 -650 1150 -600 600 -650 550 -650 500 -650 600 -650 1150 -650 550 -650 550 -600 600 -600 600
0
Could not decode message
Raw (26): 31102 2350 -650 1150 -650 1150 -650 550 -650 550 -650 500 -700 500 -700 550 -700 1150 -650 500 -700 550 -650 550 -650 500

One or two Sony were detected out of about 30 presses (I have just a shown some above to include a Sony that "worked").  I was using pin10 for the input.

Cheers, Rob
Logged

Learning Flute and C++, heading for a meltdown.

Offline Offline
Edison Member
*
Karma: 5
Posts: 1730
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I ended up using an uno for the project, was just easier at the time
either way I found trying to receive raw data was always irregular but nec, sont and rc5 all work pretty well
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Pin 9 on the Mega works, great link above! thanks
Logged

Pages: [1]   Go Up
Jump to: