Interfacing sensors via a serial port in C