Magic IR
Ragtop
Posts: 406
I am trying to use Gadget Gangster's Magic IR to trigger the play button on my Bose, but I keep getting a different set of values each time.
It works when I use the demo program, but when I try to feed magicir.playcode(4,play,127) from an array in DAT where I entered the values from the code1 array variable, it is a no go.
And each time I re-run the demo program and hit the play button I get different values for code1 and code1len.
I modified the original program to output the values for code1 and code1len.
It works when I use the demo program, but when I try to feed magicir.playcode(4,play,127) from an array in DAT where I entered the values from the code1 array variable, it is a no go.
And each time I re-run the demo program and hit the play button I get different values for code1 and code1len.
I modified the original program to output the values for code1 and code1len.
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 OBJ magicir : "magicir_010" DEBUG : "Parallax Serial Terminal" VAR LONG code1[128], code1len, i,x PUB main magicir.storecode(0, @code1, @code1len) DEBUG.start(250000) waitcnt(clkfreq*8 + cnt) x:=1 repeat i from 0 to code1len x++ debug.dec(code1[i]) debug.str(string(" ")) if x == 11 debug.str(string(13)) debug.str(string("------------------------------------")) debug.str(string(13)) x:=1 debug.str(string(13)) debug.dec(code1len) repeat 'magiccir.playcode(4,play,127) magicir.playcode(4,@code1,@code1len) waitcnt(clkfreq*5 + cnt) DAT Play long 85958,200065,245599,359681,405554, 519313, 565188, 599137, 644670, 758433 long 804301, 918385, 963916, 997857, 1043729, 1077665, 1123207, 1157153, 1202692, 1236641 long 1282175, 1316113, 1361661, 1475761, 1521310, 1555265, 1600795, 1634737, 1680614, 1794369 long 1840238, 1954001, 1999870, 2113297, 2158834, 6188705, 6274315, 6388417, 6434295, 6548049 long 6593931, 6707697, 6753573, 6787521, 6833389, 6947137, 6993010, 7106769, 7152653, 7186593 long 7232141, 7266097, 7311625, 7345569, 7391111, 7425057, 7470942, 7504545, 7550428, 7664193 long 7710075, 7744017, 7789561, 7823505, 7869045, 7982817, 8028689, 8142785, 8188324, 8301745 long 8347626, 12378289, 12464245, 12578353, 12624230, 12738001, 12783867, 12897617, 12943481, 12977761 long 13022973, 13137073, 13182957, 13296721, 13342603, 13376545, 13422085, 13456033, 13501575, 13535521 long 13581061, 13615009, 13660551, 13694833, 13740041, 13854145, 13900033, 13933985, 13979525, 14013473 long 14059020, 14172785, 14218675, 14332449, 14378330, 14491425, 14537300, 18567169, 18652785, 18766897 long 18812778, 18926545, 18972427, 19086209, 19132090, 19166385, 19211590, 19325697, 19371577, 19485345 long 19531236, 19565185, 19610728, 19644673, 19690216, 19724497, 19769703, 19803985
Comments
Timing values will change slightly, too.
One thing that's odd is you have 127 transitions - although there's space for that many, the code shouldn't need 127 transitions.
Try re-recording the IR command, but this time just quickly press the button. Is the transition count shorter?
I rewrote the Parallax Serial Terminal output for an easier cut and paste.
The unlimited power your code provides is intoxicating. Oh, the possibilities.
http://www.savagecircuits.com/forums/showthread.php?169-Networked-Universal-Remote
The Panasonic PNA4601M uses a 36.7 kHz carrier frequency while the Vishay TSOP4838 uses 38kHz.
Which frequency is used by most remotes?
A mouser part # would be helpful if you happen to know.
Thanks
I just came across this page tonight. It has 3 different IR LED's. (Interesting)...
http://www.rentron.com/remote_control/IRLED.htm
Then see "The Transmitter" at the following link. This discusses IR LED's and so forth...
http://www.sbprojects.com/knowledge/ir/ir.htm
BILL190 - Thanks. That was very interesting reading !
This object:
-- http://obex.parallax.com/objects/462/
... will let you transmit serial using an IR LED. The receive end is a standard IR receiver module.