Major updates for error checking, serial comms, and hardware trigger
use FILE instead of fd for reading from serial
merge