IR Question
Moderators: Shine, Insert_witty_name
IR Question
i love the new ir function, i was playing around with it and its pretty neat. i was wondering tho, can i read the command that a button on my tv remote is sending, and send that command to do stuff with my tv. i know its just a pulse rate on the LED and not really a command, but is there a way to do it this way? thanx
"There is no spoone"
-The Matricks
-The Matricks
nope, Ive tried this with simple C programs, too many variables. You can recieve the IR and display them, acording to what I see in the source.
EDIT
Alright, I used my modified .11 and I can make it do what my C program did!
NOTE: the print() function uses teh debug library, which uses a different text encoding, so dont try the screen:print(), all it does it print letters that look like static.
EDIT
Alright, I used my modified .11 and I can make it do what my C program did!
put that in an index.lua and run it, it will recieve the IR signal and print it on the screen.print("")
System.irdaInit()
while true do
input = Controls.read()
if input:start() then break end
irtext = System.irdaRead()
if irtext ~= "" then
print(irtext)
end
end
NOTE: the print() function uses teh debug library, which uses a different text encoding, so dont try the screen:print(), all it does it print letters that look like static.
what if i made a program to count the number of milliseconds between inputs, and output every x milliseconds. it really wouldnt matter what character is outputted, just so it lights up the LED. that could work theoretically, right?
EDIT: I made a program to do this and i counted 17 milliseconds between pulses on my TV power button on my remote. im going to try to output any character once every 17 milliseconds to see if it will turn it on.
EDIT2: Doesnt work... how do all these other programs made in C do it? like the one that controlls a phillips TV...
EDIT: I made a program to do this and i counted 17 milliseconds between pulses on my TV power button on my remote. im going to try to output any character once every 17 milliseconds to see if it will turn it on.
EDIT2: Doesnt work... how do all these other programs made in C do it? like the one that controlls a phillips TV...
"There is no spoone"
-The Matricks
-The Matricks
Re: IR Question
There are 3 infrared modes for PSP: IrDA (see http://forums.ps2dev.org/viewtopic.php?t=2555 for an example program in C, which I've used as the base for the Lua Player implementation), SIRCS for Sony remote controls (see http://forums.ps2dev.org/viewtopic.php?p=17336#17336 for some oscilloscope pictures of the signal) and custom mode for other remote controls (see http://forums.ps2dev.org/viewtopic.php?t=3140 for the nice hack from PspPet). IrDA is implemented in Lua Player, SIRCS and general IR is on the TODO list at http://wiki.ps2dev.org/psp:lua_player:todosMr Billy wrote:i was wondering tho, can i read the command that a button on my tv remote is sending, and send that command to do stuff with my tv.
As it is already implemented I have to provide some nice Lua API for it, only and copy and paste the implementations. Do you have some ideas how the Lua functions for SIRCS and general IR should look like?
Re: IR Question
As it is already implemented I have to provide some nice Lua API for it, only and copy and paste the implementations. Do you have some ideas how the Lua functions for SIRCS and general IR should look like?[/quote]
i honestly have no idea how they should look, im new to the whole IR thing. since i dont have wifi in my house (i live in a cave :P) this is the closest thing i have to wireless communications. i cant wait til i can interface my psp with my laptop or control my tv, vcr, dvd player, and surround with my psp.
and a little tip to anyone that likes to see what their IR LED is doing... use your webcam. most digital cameras and webcams pick up ir, so you can see it if u need.
i honestly have no idea how they should look, im new to the whole IR thing. since i dont have wifi in my house (i live in a cave :P) this is the closest thing i have to wireless communications. i cant wait til i can interface my psp with my laptop or control my tv, vcr, dvd player, and surround with my psp.
and a little tip to anyone that likes to see what their IR LED is doing... use your webcam. most digital cameras and webcams pick up ir, so you can see it if u need.
"There is no spoone"
-The Matricks
-The Matricks
Re: IR Question
Well, for SIRCS don't you have to convert the signal to HEX, then switch numbers, then do more confusing stuff?Shine wrote:As it is already implemented I have to provide some nice Lua API for it, only and copy and paste the implementations. Do you have some ideas how the Lua functions for SIRCS and general IR should look like?
I think if your going to put it in, make it like the 3D stuff where its the same command, and maybe include some instructions on how to get the numbers for it.
Re: IR Question
I think it is a general sistem to obtain IR codes from any remote controller.youresam wrote:Well, for SIRCS don't you have to convert the signal to HEX, then switch numbers, then do more confusing stuff?
Sony, for an example, encodes each command as an AGC burst (2400picoseconds) followed by a 7-bit command field and a 5-bit device field transmitted lsb (last significant bit) to msb (most sb). A "0" bit is encodes as 600 picosec idle followed by a 600 picosec pulse; while a "1" bit is encodes as 600 picosec idle followed by a 1200 picosec pulse.
Starting from the HEX code you read, you can generate (with a script) almost every other code for your device (without saving each signal).
Another point is: I don't know if there is a filter in front of the IR diod (like the Newton MP2100 has) which can prevent the PSP to read ir signals with a frequency different from ~ 40 KHz (Sony frq).