Run the following commands before continuing:
sudo apt-get update
sudo apt-get upgrade
sudo rpi-update
Get signals from the IR receiver in Python:
Create the lircrc file as follows:
sudo nano /etc/lirc/lircrc
Then add the following lines:
begin
button = KEY_UP
prog = testir
config = down
end
begin
button = KEY_DOWN
prog = testir
config = down
end
To save, press CTRL+X -> y -> Enter
Create the python file as follows:
sudo nano testir.py
Then type the following code:
import lircsockid = lirc.init("testir", blocking = False)
codeIR = lirc.nextcode()
print codeIR[0]
To save, press CTRL+X -> y -> Enter
Send signals to the IR transmitter in Python:
Create the file as follows:
sudo nano testir_send.py
Then type the following code:
from lirc import Lirc
lirc_obj = Lirc()
# Show hooked up devices:
print ", ".join(lirc_obj.devices())
#Send a command
lirc_obj.send_once('CoolComand', 'KEY_POWER')
To save, press CTRL+X -> y -> Enter
sudo apt-get update
sudo apt-get upgrade
sudo rpi-update
Get signals from the IR receiver in Python:
Create the lircrc file as follows:
sudo nano /etc/lirc/lircrc
Then add the following lines:
begin
button = KEY_UP
prog = testir
config = down
end
begin
button = KEY_DOWN
prog = testir
config = down
end
To save, press CTRL+X -> y -> Enter
Create the python file as follows:
sudo nano testir.py
Then type the following code:
import lircsockid = lirc.init("testir", blocking = False)
codeIR = lirc.nextcode()
print codeIR[0]
To save, press CTRL+X -> y -> Enter
Send signals to the IR transmitter in Python:
Create the file as follows:
sudo nano testir_send.py
Then type the following code:
from lirc import Lirc
lirc_obj = Lirc()
# Show hooked up devices:
print ", ".join(lirc_obj.devices())
#Send a command
lirc_obj.send_once('CoolComand', 'KEY_POWER')
To save, press CTRL+X -> y -> Enter