IR Receiver¶
raspbot.sensors.ir.IRReceiver
Reads key-codes from the on-board IR remote-control receiver.
- Enable/disable via register
0x05 - Key-code polled from register
0x0C
Access via Robot.ir.
Methods¶
enable()¶
Power on the IR receiver.
disable()¶
Power off the IR receiver.
read_keycode()¶
Read the most recent IR key-code.
If the receiver is not yet enabled, enable() is called automatically.
Returns: Key-code byte (0-255), or None when no code is available (register returns 0 when
the receiver is idle).
Context manager¶
IRReceiver supports the context manager protocol.
enable() is called on entry, disable() on exit.