Skip to main content

Module nec

Module nec 

Source
Expand description

NEC protocol (the most common consumer IR format): 38 kHz carrier, 9 ms + 4.5 ms leader, 32 data bits LSB-first, pulse-distance coded.

Constants§

CARRIER_HZ
Carrier frequency in hertz.
FRAME_PULSES
Pulses in one frame: leader, 32 bits, trailing mark.
REPEAT
The “button held” repeat frame, sent every ~108 ms.

Functions§

encode
Encodes a standard NEC frame: address, !address, command, !command.
encode_extended
Encodes an extended-NEC frame (16-bit address, no address inverse).