Add IR buffer

Added code for storing and retrieving data from the IR sensor using a
buffer.