Welcome to mirror list, hosted at ThFree Co, Russian Federation.

transmitter-test.py « demo_scripts - github.com/ClusterM/rc-transceiver.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 152c95d1f96594be7cf4c38de76930d8221d1603 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/python3

from necrc import *
from rc6 import *
from time import sleep

DEVICE = "/dev/rc"

with open(DEVICE, "w") as f:
    # Send '0' button code for Philips TV
    raw = rc6_encode(command=0, control=0, toggle=0, mode=0)
    f.write(raw + "\n")
    f.flush()

    sleep(0.1)

    # Send NEC code
    raw = nec_encode([0x00, 0xef, 0x03, 0xfc])
    f.write(raw + "\n")
    f.flush()