-
Notifications
You must be signed in to change notification settings - Fork 0
IR Recorder
Nikola Jovanovic edited this page Oct 4, 2020
·
1 revision
Fully operational and reliable IR recorder is implemented in file ir-rec_main.py
:
def ir_rx_callback(ir_decoded, ir_hex, valid):
print("ir_decoded={} len={}".format(ir_decoded, len(ir_decoded)))
print("ir_dec_hex={}".format(ir_hex))
if valid:
print("Valid IR code! Pressed button was: ")
key = input()
button_map[key] = {ir_decoded, ir_hex}
print(button_map)
pi = pigpio.pi()
ir_rec = infrared.rx(pi, IR_PIN, ir_rx_callback, 5)
It relies on 2 imported modules pigpio
and custom infrared
.